mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
fix(storage): return reason for identity verification not being found (#2937)
This includes the reason a token was not found during the identity verification process.
This commit is contained in:
parent
6ef6d0499a
commit
d867fa1a63
|
@ -255,8 +255,10 @@ func (p *SQLProvider) FindIdentityVerification(ctx context.Context, jti string)
|
|||
}
|
||||
|
||||
switch {
|
||||
case verification.Consumed != nil, verification.ExpiresAt.Before(time.Now()):
|
||||
return false, nil
|
||||
case verification.Consumed != nil:
|
||||
return false, fmt.Errorf("the token has already been consumed")
|
||||
case verification.ExpiresAt.Before(time.Now()):
|
||||
return false, fmt.Errorf("the token expired %s ago", time.Since(verification.ExpiresAt))
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user