mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-05-31 03:03:44 +00:00
feat(security): add cookie support for login and logout methods
* Implement LoginWithCookie and LogoutWithCookie in stubAuthenticator, mockAuth, mockSecurityProvider, and MockAuthenticator * Update tests to use cookie-based authentication
This commit is contained in:
@@ -23,10 +23,18 @@ func (m *mockAuth) Login(ctx context.Context, req LoginRequest) (*LoginResponse,
|
||||
return m.loginResp, m.loginErr
|
||||
}
|
||||
|
||||
func (m *mockAuth) LoginWithCookie(ctx context.Context, req LoginRequest, _ http.ResponseWriter) (*LoginResponse, error) {
|
||||
return m.Login(ctx, req)
|
||||
}
|
||||
|
||||
func (m *mockAuth) Logout(ctx context.Context, req LogoutRequest) error {
|
||||
return m.logoutErr
|
||||
}
|
||||
|
||||
func (m *mockAuth) LogoutWithCookie(ctx context.Context, req LogoutRequest, _ http.ResponseWriter) error {
|
||||
return m.Logout(ctx, req)
|
||||
}
|
||||
|
||||
func (m *mockAuth) Authenticate(r *http.Request) (*UserContext, error) {
|
||||
return m.authUser, m.authErr
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user