Add error for already used token
Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -680,7 +680,7 @@ func (s AuthService) OpenSessionWithMagicLink(ctx context.Context, tokenString s
|
||||
|
||||
if err := token.LoadByHashedValueForUpdate(ctx, tx, hashedValue); err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
return NewInvalidTokenError()
|
||||
return NewTokenAlreadyUsedError()
|
||||
}
|
||||
|
||||
return fmt.Errorf("cannot load token by hashed value: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user