added refresh tocken

This commit is contained in:
Mephimeow
2026-06-12 10:01:21 +00:00
committed by zero@thinky
parent 321cba3f9b
commit a822d8c3b6
10 changed files with 362 additions and 35 deletions
+62
View File
@@ -90,6 +90,52 @@
}
}
},
"/api/auth/refresh": {
"post": {
"description": "Get a new access token using a refresh token",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"auth"
],
"summary": "Refresh epta token",
"parameters": [
{
"description": "Refresh token",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_auth.RefreshRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/internal_auth.AuthResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/internal_auth.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/internal_auth.ErrorResponse"
}
}
}
}
},
"/api/auth/register": {
"post": {
"description": "Create user account with username, email, password",
@@ -141,6 +187,10 @@
"internal_auth.AuthResponse": {
"type": "object",
"properties": {
"refresh_token": {
"type": "string",
"example": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4="
},
"token": {
"type": "string",
"example": "eyJhbGciOiJIUzI1NiIs..."
@@ -176,6 +226,18 @@
}
}
},
"internal_auth.RefreshRequest": {
"type": "object",
"required": [
"refresh_token"
],
"properties": {
"refresh_token": {
"type": "string",
"example": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4="
}
}
},
"internal_auth.RegisterRequest": {
"type": "object",
"required": [