Skip to content

Commit 0661d09

Browse files
committed
fix: fix all logic logout login get profile
1 parent 52fc32c commit 0661d09

File tree

3 files changed

+19
-220
lines changed

3 files changed

+19
-220
lines changed

docs/swagger/docs.go

Lines changed: 7 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -74,71 +74,6 @@ const docTemplate = `{
7474
}
7575
}
7676
},
77-
"/auth/login-identifier": {
78-
"post": {
79-
"description": "Handles the login process for a user with identifier (email, phone, username)",
80-
"consumes": [
81-
"application/json"
82-
],
83-
"produces": [
84-
"application/json"
85-
],
86-
"tags": [
87-
"Auth"
88-
],
89-
"summary": "Login with identifier",
90-
"parameters": [
91-
{
92-
"description": "Login request body",
93-
"name": "body",
94-
"in": "body",
95-
"required": true,
96-
"schema": {
97-
"$ref": "#/definitions/models.BodyLoginRequest"
98-
}
99-
},
100-
{
101-
"type": "string",
102-
"description": "Device ID",
103-
"name": "X-Device-Id",
104-
"in": "header",
105-
"required": true
106-
}
107-
],
108-
"responses": {
109-
"200": {
110-
"description": "OK",
111-
"schema": {
112-
"$ref": "#/definitions/models.LoginResponse"
113-
}
114-
},
115-
"400": {
116-
"description": "Bad Request",
117-
"schema": {
118-
"$ref": "#/definitions/response.ErrorResponse"
119-
}
120-
},
121-
"401": {
122-
"description": "Unauthorized",
123-
"schema": {
124-
"$ref": "#/definitions/response.ErrorResponse"
125-
}
126-
},
127-
"403": {
128-
"description": "Forbidden",
129-
"schema": {
130-
"$ref": "#/definitions/response.ErrorResponse"
131-
}
132-
},
133-
"500": {
134-
"description": "Internal Server Error",
135-
"schema": {
136-
"$ref": "#/definitions/response.ErrorResponse"
137-
}
138-
}
139-
}
140-
}
141-
},
14277
"/auth/register": {
14378
"post": {
14479
"description": "Handles the registration process for a user",
@@ -770,7 +705,7 @@ const docTemplate = `{
770705
}
771706
},
772707
"/user/logout": {
773-
"post": {
708+
"get": {
774709
"description": "Logs out a user",
775710
"consumes": [
776711
"application/json"
@@ -1075,22 +1010,6 @@ const docTemplate = `{
10751010
}
10761011
}
10771012
},
1078-
"models.BodyLoginRequest": {
1079-
"type": "object",
1080-
"required": [
1081-
"identifier",
1082-
"password"
1083-
],
1084-
"properties": {
1085-
"identifier": {
1086-
"type": "string"
1087-
},
1088-
"password": {
1089-
"type": "string",
1090-
"minLength": 6
1091-
}
1092-
}
1093-
},
10941013
"models.BodyLoginSocialRequest": {
10951014
"type": "object",
10961015
"required": [
@@ -1205,6 +1124,9 @@ const docTemplate = `{
12051124
"email": {
12061125
"type": "string"
12071126
},
1127+
"expired_at": {
1128+
"type": "string"
1129+
},
12081130
"id": {
12091131
"type": "integer"
12101132
},
@@ -1299,6 +1221,9 @@ const docTemplate = `{
12991221
"email": {
13001222
"type": "string"
13011223
},
1224+
"expires_at_token": {
1225+
"type": "string"
1226+
},
13021227
"id": {
13031228
"type": "integer"
13041229
},

docs/swagger/swagger.json

Lines changed: 7 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -68,71 +68,6 @@
6868
}
6969
}
7070
},
71-
"/auth/login-identifier": {
72-
"post": {
73-
"description": "Handles the login process for a user with identifier (email, phone, username)",
74-
"consumes": [
75-
"application/json"
76-
],
77-
"produces": [
78-
"application/json"
79-
],
80-
"tags": [
81-
"Auth"
82-
],
83-
"summary": "Login with identifier",
84-
"parameters": [
85-
{
86-
"description": "Login request body",
87-
"name": "body",
88-
"in": "body",
89-
"required": true,
90-
"schema": {
91-
"$ref": "#/definitions/models.BodyLoginRequest"
92-
}
93-
},
94-
{
95-
"type": "string",
96-
"description": "Device ID",
97-
"name": "X-Device-Id",
98-
"in": "header",
99-
"required": true
100-
}
101-
],
102-
"responses": {
103-
"200": {
104-
"description": "OK",
105-
"schema": {
106-
"$ref": "#/definitions/models.LoginResponse"
107-
}
108-
},
109-
"400": {
110-
"description": "Bad Request",
111-
"schema": {
112-
"$ref": "#/definitions/response.ErrorResponse"
113-
}
114-
},
115-
"401": {
116-
"description": "Unauthorized",
117-
"schema": {
118-
"$ref": "#/definitions/response.ErrorResponse"
119-
}
120-
},
121-
"403": {
122-
"description": "Forbidden",
123-
"schema": {
124-
"$ref": "#/definitions/response.ErrorResponse"
125-
}
126-
},
127-
"500": {
128-
"description": "Internal Server Error",
129-
"schema": {
130-
"$ref": "#/definitions/response.ErrorResponse"
131-
}
132-
}
133-
}
134-
}
135-
},
13671
"/auth/register": {
13772
"post": {
13873
"description": "Handles the registration process for a user",
@@ -764,7 +699,7 @@
764699
}
765700
},
766701
"/user/logout": {
767-
"post": {
702+
"get": {
768703
"description": "Logs out a user",
769704
"consumes": [
770705
"application/json"
@@ -1069,22 +1004,6 @@
10691004
}
10701005
}
10711006
},
1072-
"models.BodyLoginRequest": {
1073-
"type": "object",
1074-
"required": [
1075-
"identifier",
1076-
"password"
1077-
],
1078-
"properties": {
1079-
"identifier": {
1080-
"type": "string"
1081-
},
1082-
"password": {
1083-
"type": "string",
1084-
"minLength": 6
1085-
}
1086-
}
1087-
},
10881007
"models.BodyLoginSocialRequest": {
10891008
"type": "object",
10901009
"required": [
@@ -1199,6 +1118,9 @@
11991118
"email": {
12001119
"type": "string"
12011120
},
1121+
"expired_at": {
1122+
"type": "string"
1123+
},
12021124
"id": {
12031125
"type": "integer"
12041126
},
@@ -1293,6 +1215,9 @@
12931215
"email": {
12941216
"type": "string"
12951217
},
1218+
"expires_at_token": {
1219+
"type": "string"
1220+
},
12961221
"id": {
12971222
"type": "integer"
12981223
},

docs/swagger/swagger.yaml

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,6 @@ definitions:
2222
type: string
2323
type: array
2424
type: object
25-
models.BodyLoginRequest:
26-
properties:
27-
identifier:
28-
type: string
29-
password:
30-
minLength: 6
31-
type: string
32-
required:
33-
- identifier
34-
- password
35-
type: object
3625
models.BodyLoginSocialRequest:
3726
properties:
3827
type:
@@ -108,6 +97,8 @@ definitions:
10897
properties:
10998
email:
11099
type: string
100+
expired_at:
101+
type: string
111102
id:
112103
type: integer
113104
token:
@@ -169,6 +160,8 @@ definitions:
169160
properties:
170161
email:
171162
type: string
163+
expires_at_token:
164+
type: string
172165
id:
173166
type: integer
174167
token:
@@ -294,50 +287,6 @@ paths:
294287
summary: Forget password
295288
tags:
296289
- Auth
297-
/auth/login-identifier:
298-
post:
299-
consumes:
300-
- application/json
301-
description: Handles the login process for a user with identifier (email, phone,
302-
username)
303-
parameters:
304-
- description: Login request body
305-
in: body
306-
name: body
307-
required: true
308-
schema:
309-
$ref: '#/definitions/models.BodyLoginRequest'
310-
- description: Device ID
311-
in: header
312-
name: X-Device-Id
313-
required: true
314-
type: string
315-
produces:
316-
- application/json
317-
responses:
318-
"200":
319-
description: OK
320-
schema:
321-
$ref: '#/definitions/models.LoginResponse'
322-
"400":
323-
description: Bad Request
324-
schema:
325-
$ref: '#/definitions/response.ErrorResponse'
326-
"401":
327-
description: Unauthorized
328-
schema:
329-
$ref: '#/definitions/response.ErrorResponse'
330-
"403":
331-
description: Forbidden
332-
schema:
333-
$ref: '#/definitions/response.ErrorResponse'
334-
"500":
335-
description: Internal Server Error
336-
schema:
337-
$ref: '#/definitions/response.ErrorResponse'
338-
summary: Login with identifier
339-
tags:
340-
- Auth
341290
/auth/register:
342291
post:
343292
consumes:
@@ -756,7 +705,7 @@ paths:
756705
tags:
757706
- Users
758707
/user/logout:
759-
post:
708+
get:
760709
consumes:
761710
- application/json
762711
description: Logs out a user

0 commit comments

Comments
 (0)