extract rotation logic to TokenService
This commit is contained in:
@@ -25,12 +25,20 @@ public class GoogleVerifierService {
|
||||
throw new NotAuthenticated("Invalid ID token: " + e.getMessage());
|
||||
}
|
||||
|
||||
if (token == null) {
|
||||
throw new NotAuthenticated("Invalid ID token");
|
||||
}
|
||||
|
||||
String googleId = token.getPayload().getSubject();
|
||||
|
||||
if (googleId == null) {
|
||||
throw new NotAuthenticated("Google ID does not exist");
|
||||
}
|
||||
|
||||
if (!Boolean.TRUE.equals(token.getPayload().getEmailVerified())) {
|
||||
throw new NotAuthenticated("Email not verified");
|
||||
}
|
||||
|
||||
return new GoogleUser(
|
||||
googleId,
|
||||
token.getPayload().getEmail(),
|
||||
|
||||
Reference in New Issue
Block a user