yao/openapi/otp/revoke.go
Max 37ab2bc84b Enhance user login functionality with options for customization
- Introduce `LoginWithOptions` method to allow for customizable login flows, enabling overrides for scopes, token expiration, and refresh token issuance.
- Add `LoginOptions` struct to encapsulate optional parameters for login, improving flexibility in user authentication.
- Update token handling in `issueTokens` to accommodate new options, ensuring proper management of access and refresh tokens based on user preferences.
- Integrate OTP service initialization into the OpenAPI server setup for enhanced authentication capabilities.
2026-02-21 21:38:39 +08:00

12 lines
280 B
Go

package otp
// Revoke removes an OTP code from the store immediately.
// It is silent when the code does not exist or has already expired.
func (s *Service) Revoke(code string) error {
if code == "" {
return nil
}
key := s.storeKey(code)
_ = s.store.Del(key)
return nil
}