added logout
This commit is contained in:
@@ -61,6 +61,55 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/logout": {
|
||||
"post": {
|
||||
"description": "Invalidate a refresh token (logout)",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Logout epta",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Refresh token to invalidate",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.LogoutRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/me": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -231,6 +280,18 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.LogoutRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"refresh_token"
|
||||
],
|
||||
"properties": {
|
||||
"refresh_token": {
|
||||
"type": "string",
|
||||
"example": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4="
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.RefreshRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
@@ -56,6 +56,55 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/logout": {
|
||||
"post": {
|
||||
"description": "Invalidate a refresh token (logout)",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"auth"
|
||||
],
|
||||
"summary": "Logout epta",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "Refresh token to invalidate",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.LogoutRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Bad Request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/internal_auth.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/api/auth/me": {
|
||||
"get": {
|
||||
"security": [
|
||||
@@ -226,6 +275,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.LogoutRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"refresh_token"
|
||||
],
|
||||
"properties": {
|
||||
"refresh_token": {
|
||||
"type": "string",
|
||||
"example": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4="
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_auth.RefreshRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
@@ -28,6 +28,14 @@ definitions:
|
||||
- email
|
||||
- password
|
||||
type: object
|
||||
internal_auth.LogoutRequest:
|
||||
properties:
|
||||
refresh_token:
|
||||
example: dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4=
|
||||
type: string
|
||||
required:
|
||||
- refresh_token
|
||||
type: object
|
||||
internal_auth.RefreshRequest:
|
||||
properties:
|
||||
refresh_token:
|
||||
@@ -107,6 +115,38 @@ paths:
|
||||
summary: Epta login
|
||||
tags:
|
||||
- auth
|
||||
/api/auth/logout:
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Invalidate a refresh token (logout)
|
||||
parameters:
|
||||
- description: Refresh token to invalidate
|
||||
in: body
|
||||
name: request
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/internal_auth.LogoutRequest'
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
"400":
|
||||
description: Bad Request
|
||||
schema:
|
||||
$ref: '#/definitions/internal_auth.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/internal_auth.ErrorResponse'
|
||||
summary: Logout epta
|
||||
tags:
|
||||
- auth
|
||||
/api/auth/me:
|
||||
get:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user