Stage 11: account linking & merge (email + Telegram Login Widget) (#12)
This commit was merged in pull request #12.
This commit is contained in:
@@ -71,3 +71,14 @@ func (svc *Service) Revoke(ctx context.Context, token string) error {
|
||||
svc.cache.Remove(hash)
|
||||
return nil
|
||||
}
|
||||
|
||||
// RevokeAllForAccount revokes every active session of accountID and evicts them
|
||||
// from the cache. The account-merge flow calls it to retire a secondary account
|
||||
// (Stage 11). It is idempotent.
|
||||
func (svc *Service) RevokeAllForAccount(ctx context.Context, accountID uuid.UUID) error {
|
||||
if _, err := svc.store.RevokeAllForAccount(ctx, accountID, time.Now().UTC()); err != nil {
|
||||
return err
|
||||
}
|
||||
svc.cache.RemoveByAccount(accountID)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user