- 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.
12 lines
280 B
Go
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
|
|
}
|