Repository navigation
Logging out
Logout clears the application's identity and visits the provider to clear its authentication session too.
Inside a wrapped route:
destination := "/signed-out"
if err := auth.Logout(&destination, nil); err != nil { return nil, err }The signed-out route displays the result without invoking logout again. Other application session data, such as a shopping basket, remains intact.
Destination precedence is:
- The explicit logout argument.
- The configured return URI.
- The provider's deployment default.
Without either argument, the provider returns to its configured client URI with do=logout. Local authentication is already cleared. Validate destinations supplied through request data against the routes and origins your application permits.
Destinations are URI strings. Pass a pointer for an explicit destination, or nil to use the configured return URI or provider default.
destination := "?signed-out=1"
if err := auth.Logout(&destination, nil); err != nil { return nil, err }At /account?tab=security, this requests /account?signed-out=1. The query-only form uses the current request path even when another return URI is configured.
The client clears stored and in-memory authentication before redirecting. The login state is already false when a custom redirect handler runs, and reading the user reports not logged in. The default status is 303. Clearing local data alone does not end the provider session; use logout to visit the provider.
Users with email FakeEmail (fakelogin@authwave.com) log out locally without a provider redirect. Fake users with another email follow ordinary provider logout. See Development and testing.
Next, see Provider links.
Authwave’s Go client connects your application to an Authwave provider.