Skip to content

Commit

Permalink
feat: add configuration option to skip email verification in OIDC log…
Browse files Browse the repository at this point in the history
…in flow

Closes: #1054
  • Loading branch information
gotson committed Jan 27, 2023
1 parent 72e5fd9 commit 273b7d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class KomgaProperties {

var oauth2AccountCreation: Boolean = false

var oidcEmailVerification: Boolean = true

var database = Database()

var cors = Cors()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class KomgaOAuth2UserServiceConfiguration(
val oidcUser = delegate.loadUser(userRequest)

if (oidcUser.email == null) throw OAuth2AuthenticationException("ERR_1028")
if (oidcUser.emailVerified == null) throw OAuth2AuthenticationException("ERR_1027")
if (oidcUser.emailVerified == false) throw OAuth2AuthenticationException("ERR_1026")
if (komgaProperties.oidcEmailVerification && oidcUser.emailVerified == null) throw OAuth2AuthenticationException("ERR_1027")
if (komgaProperties.oidcEmailVerification && oidcUser.emailVerified == false) throw OAuth2AuthenticationException("ERR_1026")

val existingUser = userRepository.findByEmailIgnoreCaseOrNull(oidcUser.email)
?: tryCreateNewUser(oidcUser.email)
Expand Down

0 comments on commit 273b7d2

Please sign in to comment.