Skip to content

Commit

Permalink
#135 Fix codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
vityaman committed Jun 13, 2024
1 parent 6e2ce73 commit 514e06f
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ class SpringJwtAuthManager(
) : ReactiveAuthenticationManager {
override fun authenticate(
authentication: Authentication,
): Mono<Authentication> = mono {
): Mono<Authentication> = mono { doAuthenticate(authentication) }

private suspend fun doAuthenticate(
authentication: Authentication,
): Authentication {
val credentials = authentication.credentials.toString()
if (credentials == "prometheus-top-top-top-secret-token") {
return@mono UsernamePasswordAuthenticationToken(null, null, null)
return UsernamePasswordAuthenticationToken(null, null, null)
}

val token = AccessToken(credentials)
Expand All @@ -33,6 +37,6 @@ class SpringJwtAuthManager(

val roles = emptyList<GrantedAuthority>()

UsernamePasswordAuthenticationToken(user, null, roles)
return UsernamePasswordAuthenticationToken(user, null, roles)
}
}

0 comments on commit 514e06f

Please sign in to comment.