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.pull/2938/head
parent
6ef6d0499a
commit
d867fa1a63
|
@ -255,8 +255,10 @@ func (p *SQLProvider) FindIdentityVerification(ctx context.Context, jti string)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case verification.Consumed != nil, verification.ExpiresAt.Before(time.Now()):
|
case verification.Consumed != nil:
|
||||||
return false, 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:
|
default:
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue