feat: add validator for jwt

This commit is contained in:
d3m0k1d
2026-02-14 21:51:44 +03:00
parent 4712604171
commit 2b794f97a3
6 changed files with 183 additions and 6 deletions

View File

@@ -382,6 +382,36 @@ const docTemplate = `{
}
}
}
},
"/session": {
"get": {
"description": "Returns user session data",
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Get user session",
"responses": {
"200": {
"description": "Session data",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {

View File

@@ -371,6 +371,36 @@
}
}
}
},
"/session": {
"get": {
"description": "Returns user session data",
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Get user session",
"responses": {
"200": {
"description": "Session data",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
},
"definitions": {

View File

@@ -272,6 +272,26 @@ paths:
summary: Update post
tags:
- posts
/session:
get:
description: Returns user session data
produces:
- application/json
responses:
"200":
description: Session data
schema:
additionalProperties: true
type: object
"401":
description: Unauthorized
schema:
additionalProperties:
type: string
type: object
summary: Get user session
tags:
- auth
securityDefinitions:
Bearer:
description: Type "Bearer" followed by a space and the JWT token.