mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-24 07:53:45 +00:00
feat(auth): add authenticate callback for fallback logic
* Implement SetAuthenticateCallback in authenticators * Update Authenticate methods to use callback on failure
This commit is contained in:
@@ -99,6 +99,10 @@ type Authenticator interface {
|
||||
// Authenticate extracts and validates user from HTTP request
|
||||
// Returns UserContext or error if authentication fails
|
||||
Authenticate(r *http.Request) (*UserContext, error)
|
||||
|
||||
// SetAuthenticateCallback registers a fallback called when primary authentication fails.
|
||||
// If the callback returns a non-nil UserContext, that result is used instead of the error.
|
||||
SetAuthenticateCallback(fn func(r *http.Request) (*UserContext, error))
|
||||
}
|
||||
|
||||
// Registrable allows providers to support user registration
|
||||
|
||||
Reference in New Issue
Block a user