Skip to content

Commit

Permalink
fix: add has verified factor mfa claim
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Nov 13, 2024
1 parent 9ce2857 commit ea50a0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/api/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ func (a *API) generateAccessToken(r *http.Request, tx *storage.Connection, user
Role: user.Role,
SessionId: sid,
AuthenticatorAssuranceLevel: aal.String(),
// MFA is enabled if a developer has one at least one verified factor
HasVerifiedFactor: user.HasMFAEnabled(),
AuthenticationMethodReference: amr,
IsAnonymous: user.IsAnonymous,
}
Expand Down
1 change: 1 addition & 0 deletions internal/hooks/auth_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type AccessTokenClaims struct {
AuthenticatorAssuranceLevel string `json:"aal,omitempty"`
AuthenticationMethodReference []models.AMREntry `json:"amr,omitempty"`
SessionId string `json:"session_id,omitempty"`
HasVerifiedFactor bool `json:"has_verified_factor"`
IsAnonymous bool `json:"is_anonymous"`
}

Expand Down

0 comments on commit ea50a0d

Please sign in to comment.