-
Notifications
You must be signed in to change notification settings - Fork 1
3. Logout
Nguyen Ngoc Phuong edited this page Feb 21, 2023
·
1 revision
Currently, the logout feature is just providing a way to customize the logout process. It won't invalidate the token.
POST /logout
Request Field | Field Type | Required | Field Desc |
---|---|---|---|
Authorization | Bearer | true | access_token for authenticate |
Response Field | Field Type | Required | Field Desc |
---|---|---|---|
N/A | N/A | N/A | return code 204 - noContent |
curl -X 'POST' \
'http://localhost/api/logout' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1...' \
-d ''
{}
Bellow is the list of configurable method of UserService that can be used to custom your logout behavior. All the methods implementation are available at: https://github.com/sun-asterisk/tech-standard-nest-auth/blob/master/src/baseuser.service.ts
This method can be override to transform the response of the logout request. It can also be used for implementing the invalidate token
logic. This method accept the access_token
of the current logout request, so you can implement the token invalidation
logic by yourself.
onBeforeLogoutResponse(accessToken: string): Promise<any>;