-
Notifications
You must be signed in to change notification settings - Fork 0
Draft: Implement Auth #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
69aa0f5
183d3bb
6286698
185be1b
9801367
a6de26c
64664f7
9fd741a
e1ca78a
eef6d70
a8ff2bd
535bcf8
3c63caf
85e9f77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,23 @@ | ||
| dependencies { | ||
| implementation 'org.springframework.boot:spring-boot-starter-web' | ||
| implementation "org.springframework.boot:spring-boot-starter-validation" | ||
| implementation 'org.springframework.boot:spring-boot-starter-security' | ||
|
|
||
| implementation 'io.jsonwebtoken:jjwt-api:0.13.0' | ||
| runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.13.0' | ||
| runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.13.0' | ||
|
|
||
| implementation 'org.mapstruct:mapstruct:1.5.5.Final' | ||
| annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final' | ||
|
|
||
| implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
| runtimeOnly 'org.postgresql:postgresql' | ||
|
|
||
| runtimeOnly('org.postgresql:postgresql') | ||
|
|
||
| implementation 'org.springframework.boot:spring-boot-starter-kafka' | ||
| testImplementation 'org.springframework.kafka:spring-kafka-test' | ||
|
|
||
|
|
||
| implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.2' | ||
|
|
||
|
|
||
| implementation project(':smartjam-common') | ||
| implementation("software.amazon.awssdk:s3:2.29.22") | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package com.smartjam.smartjamapi.config; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.security.core.userdetails.UserDetailsService; | ||
| import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; | ||
| import org.springframework.security.crypto.password.PasswordEncoder; | ||
|
|
||
| @Configuration | ||
| @RequiredArgsConstructor | ||
| public class ApplicationConfig { | ||
|
|
||
| private final CustomUserDetailsService customUserDetailsService; | ||
|
|
||
| @Bean | ||
| public UserDetailsService userDetailsService() { | ||
| return customUserDetailsService::loadUserByUsername; | ||
| } | ||
|
|
||
| @Bean | ||
| public PasswordEncoder passwordEncoder() { | ||
| return new BCryptPasswordEncoder(); | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package com.smartjam.smartjamapi.config; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
|
|
||
| import com.smartjam.smartjamapi.entity.UserEntity; | ||
| import com.smartjam.smartjamapi.repository.UserRepository; | ||
| import com.smartjam.smartjamapi.security.UserDetailsImpl; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.security.core.userdetails.UserDetailsService; | ||
| import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| @Service | ||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @RequiredArgsConstructor | ||
| public class CustomUserDetailsService implements UserDetailsService { | ||
|
|
||
| private final UserRepository userRepository; | ||
|
|
||
| @Override | ||
| public UserDetailsImpl loadUserByUsername(@NotBlank String email) throws UsernameNotFoundException { | ||
| UserEntity user = userRepository | ||
| .findByEmail(email) | ||
| .orElseThrow(() -> new UsernameNotFoundException("Invalid credentials")); | ||
|
Comment on lines
+19
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial
The Proposed defensive check `@Override`
public UserDetailsImpl loadUserByUsername(`@NotBlank` String email) throws UsernameNotFoundException {
+ if (email == null || email.isBlank()) {
+ throw new UsernameNotFoundException("Invalid credentials");
+ }
UserEntity user = userRepository
.findByEmail(email)
.orElseThrow(() -> new UsernameNotFoundException("Invalid credentials"));🤖 Prompt for AI Agents |
||
|
|
||
| return UserDetailsImpl.build(user); | ||
| } | ||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package com.smartjam.smartjamapi.config; | ||
|
|
||
| import com.smartjam.smartjamapi.security.JwtAuthenticationFilter; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; | ||
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
| import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; | ||
| import org.springframework.security.config.http.SessionCreationPolicy; | ||
| import org.springframework.security.web.SecurityFilterChain; | ||
| import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; | ||
|
|
||
| @Configuration | ||
| @EnableWebSecurity | ||
| @EnableMethodSecurity | ||
| @RequiredArgsConstructor | ||
| public class SecurityConfig { | ||
|
|
||
| private final JwtAuthenticationFilter jwtAuthFilter; | ||
|
|
||
| @Bean | ||
| public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { | ||
| http.csrf(AbstractHttpConfigurer::disable) | ||
| .authorizeHttpRequests(auth -> auth.requestMatchers("/api/auth/**") | ||
| .permitAll() | ||
| .anyRequest() | ||
| .authenticated()) | ||
| .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) | ||
| .addFilterBefore(jwtAuthFilter, UsernamePasswordAuthenticationFilter.class); | ||
|
|
||
| return http.build(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package com.smartjam.smartjamapi.controller; | ||
|
|
||
| import jakarta.validation.Valid; | ||
|
|
||
| import com.smartjam.smartjamapi.dto.AuthResponse; | ||
| import com.smartjam.smartjamapi.dto.LoginRequest; | ||
| import com.smartjam.smartjamapi.dto.RefreshTokenRequest; | ||
| import com.smartjam.smartjamapi.dto.RegisterRequest; | ||
| import com.smartjam.smartjamapi.service.AuthService; | ||
| import lombok.RequiredArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.*; | ||
|
|
||
| @RestController | ||
| @Slf4j | ||
| @RequestMapping("/api/auth") | ||
| @RequiredArgsConstructor | ||
| public class AuthController { | ||
|
|
||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| private final AuthService authService; | ||
|
|
||
| @PostMapping("/login") | ||
| public ResponseEntity<AuthResponse> login(@RequestBody @Valid LoginRequest request) { | ||
| log.info("Calling login"); | ||
| return ResponseEntity.ok(authService.login(request)); | ||
| } | ||
|
|
||
| @PostMapping("/register") | ||
| public ResponseEntity<AuthResponse> register(@RequestBody @Valid RegisterRequest request) { | ||
| log.info("Calling register"); | ||
| return ResponseEntity.status(201).body(authService.register(request)); | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| @PostMapping("/refresh") | ||
| public ResponseEntity<AuthResponse> getNewTokens(@RequestBody @Valid RefreshTokenRequest refreshTokenRequest) { | ||
| log.info("Calling getNewToken"); | ||
| return ResponseEntity.ok(authService.getNewTokens(refreshTokenRequest)); | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||
| package com.smartjam.smartjamapi.controller; | ||||||
|
|
||||||
| import java.security.Principal; | ||||||
|
|
||||||
| import lombok.extern.slf4j.Slf4j; | ||||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||||
| import org.springframework.web.bind.annotation.RestController; | ||||||
|
|
||||||
| @RestController | ||||||
| @RequestMapping("/secured") | ||||||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| @Slf4j | ||||||
| public class MainController { | ||||||
|
|
||||||
| @GetMapping("/user") | ||||||
| public String userAccess(Principal principal) { | ||||||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| log.info(principal.getName()); | ||||||
|
|
||||||
| log.info("userAccess called for: {}", principal.getName()); | ||||||
| return principal.getName(); | ||||||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| } | ||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| @GetMapping("/hello") | ||||||
| // @PreAuthorize() | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Remove commented-out Line 24 leaves dead/commented security code in place, which makes intent unclear. 🧹 Proposed cleanup- // `@PreAuthorize`()📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| public String hello() { | ||||||
| return "You are auth"; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo: "auth" should likely be "authenticated". The message "You are auth" appears truncated. Consider using a complete message. Proposed fix- return "You are auth";
+ return "You are authenticated";📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package com.smartjam.smartjamapi.controller; | ||
|
|
||
| import jakarta.validation.Valid; | ||
|
|
||
| import com.smartjam.smartjamapi.dto.UploadRequest; | ||
| import com.smartjam.smartjamapi.dto.UploadUrlResponse; | ||
| import com.smartjam.smartjamapi.service.UploadService; | ||
| import lombok.AllArgsConstructor; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @RestController | ||
| @AllArgsConstructor | ||
| public class UploadController { | ||
|
|
||
| private final UploadService uploadService; | ||
|
|
||
| @PostMapping("/upload-url") | ||
| public ResponseEntity<UploadUrlResponse> getUploadUrl(@RequestBody @Valid UploadRequest request) { | ||
| return ResponseEntity.ok(uploadService.generateUploadUrl(request.fileName())); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.smartjam.smartjamapi.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| public record AuthResponse( | ||
| @JsonProperty("refresh_token") String refreshToken, | ||
| @JsonProperty("access_token") String accessToken) {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.smartjam.smartjamapi.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import com.smartjam.smartjamapi.enums.ErrorCode; | ||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| public record ErrorResponseDto(ErrorCode code, String message, LocalDateTime errorTime) {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| package com.smartjam.smartjamapi.dto; | ||
|
|
||
| public record LoginRequest(String email, String password) {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.smartjam.smartjamapi.dto; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| public record RefreshTokenRequest( | ||
| @NotBlank @JsonProperty("refresh_token") String refreshToken) {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| package com.smartjam.smartjamapi.dto; | ||
|
|
||
| public record RegisterRequest(String email, String nickname, String password) {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.smartjam.smartjamapi.dto; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
|
|
||
| public record UploadRequest(@NotBlank String fileName) {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| package com.smartjam.smartjamapi.dto; | ||
|
|
||
| public record UploadUrlResponse(String uploadUrl) {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package com.smartjam.smartjamapi.entity; | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| import java.time.Instant; | ||
| import java.util.UUID; | ||
|
|
||
| import jakarta.persistence.*; | ||
|
|
||
| import com.smartjam.smartjamapi.enums.StatusRefreshToken; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @Entity | ||
| @Table(name = "refresh_tokens") | ||
| @Data | ||
| @NoArgsConstructor | ||
|
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial
Proposed fix-@Data
+@Getter
+@Setter
+@EqualsAndHashCode(onlyExplicitlyIncluded = true)
`@NoArgsConstructor`
public class RefreshTokenEntity {
`@Id`
`@GeneratedValue`(strategy = GenerationType.UUID)
+ `@EqualsAndHashCode.Include`
private UUID id;🤖 Prompt for AI Agents |
||
| public class RefreshTokenEntity { | ||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.UUID) | ||
| private UUID id; | ||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @Column(nullable = false, unique = true) | ||
| private String tokenHash; | ||
|
|
||
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "user_id", nullable = false) | ||
| private UserEntity user; | ||
|
|
||
| @Column(nullable = false, name = "expires_at") | ||
| private Instant expiresAt; | ||
|
|
||
| @Column(nullable = false) | ||
| private StatusRefreshToken status; | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||||||||||||||||||||||||
| package com.smartjam.smartjamapi.entity; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import java.time.Instant; | ||||||||||||||||||||||||||||
| import java.util.UUID; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import jakarta.persistence.*; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| import com.smartjam.smartjamapi.enums.Role; | ||||||||||||||||||||||||||||
| import lombok.AllArgsConstructor; | ||||||||||||||||||||||||||||
| import lombok.Getter; | ||||||||||||||||||||||||||||
| import lombok.NoArgsConstructor; | ||||||||||||||||||||||||||||
| import lombok.Setter; | ||||||||||||||||||||||||||||
| import org.hibernate.annotations.CreationTimestamp; | ||||||||||||||||||||||||||||
| import org.hibernate.annotations.UpdateTimestamp; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Setter | ||||||||||||||||||||||||||||
| @Getter | ||||||||||||||||||||||||||||
| @NoArgsConstructor | ||||||||||||||||||||||||||||
| @AllArgsConstructor | ||||||||||||||||||||||||||||
| @Table(name = "users") | ||||||||||||||||||||||||||||
| @Entity | ||||||||||||||||||||||||||||
| public class UserEntity { | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Id | ||||||||||||||||||||||||||||
| @GeneratedValue(strategy = GenerationType.UUID) | ||||||||||||||||||||||||||||
| private UUID id; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Column(nullable = false) | ||||||||||||||||||||||||||||
| private String nickname; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Column(nullable = false, unique = true) | ||||||||||||||||||||||||||||
| private String email; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Column(name = "password_hash", nullable = false) | ||||||||||||||||||||||||||||
| private String passwordHash; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Column(name = "first_name") | ||||||||||||||||||||||||||||
| private String firstName; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Column(name = "last_name") | ||||||||||||||||||||||||||||
| private String lastName; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Column(name = "avatar_url") | ||||||||||||||||||||||||||||
| private String avatarUrl; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Enumerated(EnumType.STRING) | ||||||||||||||||||||||||||||
| @Column(nullable = false) | ||||||||||||||||||||||||||||
| private Role role = Role.STUDENT; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Column(name = "fcm_token") | ||||||||||||||||||||||||||||
| private String fcmToken; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @CreationTimestamp | ||||||||||||||||||||||||||||
| @Column(name = "created_at", nullable = false, updatable = false) | ||||||||||||||||||||||||||||
| private Instant createdAt; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @UpdateTimestamp | ||||||||||||||||||||||||||||
| @Column(name = "updated_at", nullable = false) | ||||||||||||||||||||||||||||
| private Instant updatedAt; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| // @Override | ||||||||||||||||||||||||||||
| // public @NonNull Collection<? extends GrantedAuthority> getAuthorities() { | ||||||||||||||||||||||||||||
| // return List.of(new SimpleGrantedAuthority("ROLE_" + role.name())); | ||||||||||||||||||||||||||||
| // } | ||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||
| // @Override | ||||||||||||||||||||||||||||
| // public @NonNull String getPassword() { | ||||||||||||||||||||||||||||
| // return passwordHash; | ||||||||||||||||||||||||||||
| // } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
Comment on lines
+61
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Remove commented-out dead code. The commented-out 🧹 Proposed cleanup `@Column`(name = "fcm_token")
private String fcmToken;
-
- // `@Override`
- // public `@NonNull` Collection<? extends GrantedAuthority> getAuthorities() {
- // return List.of(new SimpleGrantedAuthority("ROLE_" + role.name()));
- // }
- //
- // `@Override`
- // public `@NonNull` String getPassword() {
- // return passwordHash;
- // }
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.smartjam.smartjamapi.enums; | ||
|
|
||
| public enum AvailabilityStatus { | ||
men229 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| AVAILABLE, | ||
| UNAVAILABLE, | ||
| PENDING, | ||
| BANNED | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.smartjam.smartjamapi.enums; | ||
|
|
||
| public enum ErrorCode { | ||
| INTERNAL_SERVER_ERROR, | ||
| NOT_FOUND, | ||
| BAD_REQUEST, | ||
| UNAUTHORIZED, | ||
| RESOURCE_NOT_FOUND | ||
| } | ||
|
Comment on lines
+3
to
+9
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider consolidating Both constants represent similar "not found" semantics. Having both may cause inconsistency in which one is used across the codebase. Consider using a single constant or clearly documenting when each should be used. 🤖 Prompt for AI Agents |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package com.smartjam.smartjamapi.enums; | ||
|
|
||
| public enum Role { | ||
| STUDENT, | ||
| TEACHER | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package com.smartjam.smartjamapi.enums; | ||
|
|
||
| public enum StatusRefreshToken { | ||
| ACTIVE, | ||
| USED, | ||
| REVOKED | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.