aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-05-06 17:43:03 +0300
committerArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2023-05-06 17:43:03 +0300
commite1fde2db1a8003a2e48d267dfc35ca8c8fc721da (patch)
tree9c71a8cef508fd1aa22e03ea1ff8f6abbc07296e
parentfix: enable cors (diff)
downloadlphub-e1fde2db1a8003a2e48d267dfc35ca8c8fc721da.tar.gz
lphub-e1fde2db1a8003a2e48d267dfc35ca8c8fc721da.tar.bz2
lphub-e1fde2db1a8003a2e48d267dfc35ca8c8fc721da.zip
doc: token endpoint
Diffstat (limited to '')
-rw-r--r--backend/controllers/loginController.go12
-rw-r--r--docs/docs.go37
-rw-r--r--docs/swagger.json37
-rw-r--r--docs/swagger.yaml21
4 files changed, 101 insertions, 6 deletions
diff --git a/backend/controllers/loginController.go b/backend/controllers/loginController.go
index 06cc0ba..6e1c299 100644
--- a/backend/controllers/loginController.go
+++ b/backend/controllers/loginController.go
@@ -85,13 +85,13 @@ func Login(c *gin.Context) {
85 85
86// GET Token 86// GET Token
87// 87//
88// @Summary Gets the token cookie value from the user. 88// @Summary Gets the token cookie value from the user.
89// @Tags auth 89// @Tags auth
90// @Produce json 90// @Produce json
91// 91//
92// @Success 200 {object} models.Respnose{data=models.LoginResponse} 92// @Success 200 {object} models.Response{data=models.LoginResponse}
93// @Failure 404 {object} models.Response 93// @Failure 404 {object} models.Response
94// @Router /token [get] 94// @Router /token [get]
95func GetCookie(c *gin.Context) { 95func GetCookie(c *gin.Context) {
96 cookie, err := c.Cookie("token") 96 cookie, err := c.Cookie("token")
97 if err != nil { 97 if err != nil {
diff --git a/docs/docs.go b/docs/docs.go
index cd129f0..bb6f6ab 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -680,6 +680,43 @@ const docTemplate = `{
680 } 680 }
681 } 681 }
682 }, 682 },
683 "/token": {
684 "get": {
685 "produces": [
686 "application/json"
687 ],
688 "tags": [
689 "auth"
690 ],
691 "summary": "Gets the token cookie value from the user.",
692 "responses": {
693 "200": {
694 "description": "OK",
695 "schema": {
696 "allOf": [
697 {
698 "$ref": "#/definitions/models.Response"
699 },
700 {
701 "type": "object",
702 "properties": {
703 "data": {
704 "$ref": "#/definitions/models.LoginResponse"
705 }
706 }
707 }
708 ]
709 }
710 },
711 "404": {
712 "description": "Not Found",
713 "schema": {
714 "$ref": "#/definitions/models.Response"
715 }
716 }
717 }
718 }
719 },
683 "/users/{id}": { 720 "/users/{id}": {
684 "get": { 721 "get": {
685 "consumes": [ 722 "consumes": [
diff --git a/docs/swagger.json b/docs/swagger.json
index 442745f..5ba8a71 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -673,6 +673,43 @@
673 } 673 }
674 } 674 }
675 }, 675 },
676 "/token": {
677 "get": {
678 "produces": [
679 "application/json"
680 ],
681 "tags": [
682 "auth"
683 ],
684 "summary": "Gets the token cookie value from the user.",
685 "responses": {
686 "200": {
687 "description": "OK",
688 "schema": {
689 "allOf": [
690 {
691 "$ref": "#/definitions/models.Response"
692 },
693 {
694 "type": "object",
695 "properties": {
696 "data": {
697 "$ref": "#/definitions/models.LoginResponse"
698 }
699 }
700 }
701 ]
702 }
703 },
704 "404": {
705 "description": "Not Found",
706 "schema": {
707 "$ref": "#/definitions/models.Response"
708 }
709 }
710 }
711 }
712 },
676 "/users/{id}": { 713 "/users/{id}": {
677 "get": { 714 "get": {
678 "consumes": [ 715 "consumes": [
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index fa1a26d..a39aed4 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -593,6 +593,27 @@ paths:
593 summary: Get all user and map data. 593 summary: Get all user and map data.
594 tags: 594 tags:
595 - search 595 - search
596 /token:
597 get:
598 produces:
599 - application/json
600 responses:
601 "200":
602 description: OK
603 schema:
604 allOf:
605 - $ref: '#/definitions/models.Response'
606 - properties:
607 data:
608 $ref: '#/definitions/models.LoginResponse'
609 type: object
610 "404":
611 description: Not Found
612 schema:
613 $ref: '#/definitions/models.Response'
614 summary: Gets the token cookie value from the user.
615 tags:
616 - auth
596 /users/{id}: 617 /users/{id}:
597 get: 618 get:
598 consumes: 619 consumes: