Skip to content

Commit 2e4d420

Browse files
authored
fix: google oauth login (#15)
1 parent 367c2c6 commit 2e4d420

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

noweekend-core/core-api/src/main/kotlin/noweekend/core/api/config/SecurityConfig.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class SecurityConfig {
2828
"/health",
2929
"/swagger-ui/**",
3030
"/v3/api-docs/**",
31+
"/api/v1/login/**",
3132
),
3233
"deny" to arrayOf(),
3334
)
@@ -39,6 +40,7 @@ class SecurityConfig {
3940
"/health",
4041
"/swagger-ui/**",
4142
"/v3/api-docs/**",
43+
"/api/v1/login/**",
4244
),
4345
"deny" to arrayOf(
4446
"/example",

noweekend-core/core-domain/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ dependencies {
88

99
// JWT
1010
implementation("io.jsonwebtoken:jjwt-api:0.11.5")
11+
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.11.5")
12+
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.5")
1113

1214
// jasypt
1315
implementation("com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.5")

noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/user/UserRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package noweekend.core.domain.user
22

33
interface UserRepository {
44
fun findUserById(id: String): User
5-
fun findUserByProviderAndEmail(providerType: ProviderType, email: String): User
5+
fun findUserByProviderAndEmail(providerType: ProviderType, email: String): User?
66
fun append(id: String, name: String, providerType: ProviderType, role: Role): String
77
fun modify(id: String, name: String, role: Role): String
88
fun upsert(id: String, name: String, providerType: ProviderType, role: Role): String

noweekend-storage/db-core/src/main/kotlin/noweekend/storage/db/core/user/UserCoreRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ class UserCoreRepository(
1717
.toUser()
1818
}
1919

20-
override fun findUserByProviderAndEmail(providerType: ProviderType, email: String): User {
20+
override fun findUserByProviderAndEmail(providerType: ProviderType, email: String): User? {
2121
val userEntity = queryDslRepository.findUserByProviderAndEmail(providerType, email)
22-
?: throw NoSuchElementException("User not found: $providerType, $email")
22+
?: return null
2323
return userEntity.toUser()
2424
}
2525

0 commit comments

Comments
 (0)