Skip to content

Commit 878d1ba

Browse files
Johannes WaigelJanCizmar
authored andcommitted
fix: Reformatting files correctly
1 parent 50ab9f2 commit 878d1ba

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

backend/app/src/main/kotlin/io/tolgee/configuration/PublicConfigurationDTO.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ class PublicConfigurationDTO(
5555

5656
init {
5757
if (authentication) {
58-
authMethods = AuthMethodsDTO(OAuthPublicConfigDTO(properties.authentication.github.clientId),
59-
OAuthPublicConfigDTO(properties.authentication.google.clientId))
58+
authMethods = AuthMethodsDTO(
59+
OAuthPublicConfigDTO(
60+
properties.authentication.github.clientId
61+
),
62+
OAuthPublicConfigDTO(properties.authentication.google.clientId)
63+
)
6064
}
6165
passwordResettable = properties.authentication.nativeEnabled
6266
allowRegistrations = properties.authentication.registrationsAllowed

backend/app/src/main/kotlin/io/tolgee/security/third_party/GoogleOAuthDelegate.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ class GoogleOAuthDelegate(
2929
) {
3030
private val googleConfigurationProperties: GoogleAuthenticationProperties = properties.authentication.google
3131

32-
fun getTokenResponse(receivedCode: String?, @Nullable invitationCode: String?, redirectUri: String?): JwtAuthenticationResponse {
32+
fun getTokenResponse(
33+
receivedCode: String?,
34+
@Nullable invitationCode: String?,
35+
redirectUri: String?
36+
): JwtAuthenticationResponse {
3337
try {
3438
val body = HashMap<String, String?>()
3539
body["client_id"] = googleConfigurationProperties.clientId
@@ -55,7 +59,6 @@ class GoogleOAuthDelegate(
5559
}
5660
val userResponse = exchange.body
5761

58-
5962
// check google email verified
6063
if (userResponse.email_verified == false) {
6164
throw AuthenticationException(Message.THIRD_PARTY_AUTH_NO_EMAIL)
@@ -68,7 +71,6 @@ class GoogleOAuthDelegate(
6871
}
6972
}
7073

71-
7274
val userAccountOptional = userAccountService.findByThirdParty("google", userResponse!!.sub)
7375
val user = userAccountOptional.orElseGet {
7476
userAccountService.findOptional(userResponse.email).ifPresent {
@@ -107,9 +109,7 @@ class GoogleOAuthDelegate(
107109
if (response.containsKey("error")) {
108110
throw AuthenticationException(Message.THIRD_PARTY_AUTH_ERROR_MESSAGE)
109111
}
110-
111112
throw AuthenticationException(Message.THIRD_PARTY_AUTH_UNKNOWN_ERROR)
112-
113113
} catch (e: HttpClientErrorException) {
114114
throw AuthenticationException(Message.THIRD_PARTY_AUTH_UNKNOWN_ERROR)
115115
}

backend/app/src/test/kotlin/io/tolgee/util/GoogleAuthUtil.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.tolgee.util
22

33
import io.tolgee.configuration.tolgee.TolgeeProperties
4-
import io.tolgee.security.third_party.GithubOAuthDelegate
54
import io.tolgee.security.third_party.GoogleOAuthDelegate
65
import org.mockito.kotlin.any
76
import org.mockito.kotlin.eq

0 commit comments

Comments
 (0)