AdminLogout clears the admin session cookie. Requires super-admin auth. Logic migrated from internal/graphql/admin_logout.go.
(ctx context.Context, meta RequestMetadata)
| 53 | // AdminLogout clears the admin session cookie. Requires super-admin auth. |
| 54 | // Logic migrated from internal/graphql/admin_logout.go. |
| 55 | func (p *provider) AdminLogout(ctx context.Context, meta RequestMetadata) (*model.Response, *ResponseSideEffects, error) { |
| 56 | if err := p.requireSuperAdmin(ctx, meta); err != nil { |
| 57 | return nil, nil, err |
| 58 | } |
| 59 | side := &ResponseSideEffects{} |
| 60 | side.AddCookie(cookie.BuildDeleteAdminCookie(meta.HostURL, p.Config.AdminCookieSecure)) |
| 61 | |
| 62 | metrics.RecordAuthEvent(metrics.EventAdminLogout, metrics.StatusSuccess) |
| 63 | p.AuditProvider.LogEvent(audit.Event{ |
| 64 | Action: constants.AuditAdminLogoutEvent, |
| 65 | Protocol: meta.Protocol, ActorType: constants.AuditActorTypeAdmin, |
| 66 | ResourceType: constants.AuditResourceTypeAdminSession, |
| 67 | IPAddress: meta.IPAddress, |
| 68 | UserAgent: meta.UserAgent, |
| 69 | }) |
| 70 | return &model.Response{Message: "admin logged out successfully"}, side, nil |
| 71 | } |
| 72 | |
| 73 | // AdminSession refreshes the admin session cookie. Requires super-admin auth. |
| 74 | // Logic migrated from internal/graphql/admin_session.go. |
nothing calls this directly
no test coverage detected