Method InvalidateSessionAsync
InvalidateSessionAsync(TSessionToken, CancellationToken)
Ends the session that the specified session token belongs to.
Declaration
Task InvalidateSessionAsync(TSessionToken sessionToken, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| TSessionToken | sessionToken | The token of the session to end. |
| CancellationToken | cancellationToken | A token to cancel the operation. |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
This is called when the user signs out, when validation ends a session that has expired, is past its maximum lifetime or was presented with a token from a generation that is no longer accepted, and when GetSessionAsync(TSessionToken, CancellationToken) throws an UnauthorizedApiException. A request that has a session and signs in ends that previous session through it too, unless the sign-in returns the previous session's token.
Signing out, ending the previous session at sign-in and ending a session after GetSessionAsync(TSessionToken, CancellationToken) threw in a request are not cancelled
with the request: their cancellationToken cannot be cancelled. The rechecks of SignalR connections pass a token of their own,
which is cancelled when the app shuts down.