added refresh tocken

This commit is contained in:
Mephimeow
2026-06-12 10:01:21 +00:00
parent 8c3e4b7a5a
commit 130d5d5e3d
10 changed files with 362 additions and 35 deletions
+41
View File
@@ -1,6 +1,9 @@
definitions:
internal_auth.AuthResponse:
properties:
refresh_token:
example: dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4=
type: string
token:
example: eyJhbGciOiJIUzI1NiIs...
type: string
@@ -25,6 +28,14 @@ definitions:
- email
- password
type: object
internal_auth.RefreshRequest:
properties:
refresh_token:
example: dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4=
type: string
required:
- refresh_token
type: object
internal_auth.RegisterRequest:
properties:
email:
@@ -117,6 +128,36 @@ paths:
summary: Epta get current user
tags:
- auth
/api/auth/refresh:
post:
consumes:
- application/json
description: Get a new access token using a refresh token
parameters:
- description: Refresh token
in: body
name: request
required: true
schema:
$ref: '#/definitions/internal_auth.RefreshRequest'
produces:
- application/json
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'
summary: Refresh epta token
tags:
- auth
/api/auth/register:
post:
consumes: