aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/handlers/login.go6
-rw-r--r--go.mod2
-rw-r--r--go.sum4
3 files changed, 6 insertions, 6 deletions
diff --git a/backend/handlers/login.go b/backend/handlers/login.go
index dc6e4a5..b956c3c 100644
--- a/backend/handlers/login.go
+++ b/backend/handlers/login.go
@@ -12,7 +12,7 @@ import (
12 "github.com/golang-jwt/jwt/v4" 12 "github.com/golang-jwt/jwt/v4"
13 "github.com/pektezol/leastportalshub/backend/database" 13 "github.com/pektezol/leastportalshub/backend/database"
14 "github.com/pektezol/leastportalshub/backend/models" 14 "github.com/pektezol/leastportalshub/backend/models"
15 "github.com/solovev/steam_go" 15 "github.com/pektezol/steam_go"
16) 16)
17 17
18type LoginResponse struct { 18type LoginResponse struct {
@@ -28,14 +28,14 @@ type LoginResponse struct {
28// @Success 200 {object} models.Response{data=LoginResponse} 28// @Success 200 {object} models.Response{data=LoginResponse}
29// @Router /login [get] 29// @Router /login [get]
30func Login(c *gin.Context) { 30func Login(c *gin.Context) {
31 openID := steam_go.NewOpenId(c.Request) 31 openID := steam_go.NewOpenID(c.Request)
32 switch openID.Mode() { 32 switch openID.Mode() {
33 case "": 33 case "":
34 c.Redirect(http.StatusMovedPermanently, openID.AuthUrl()) 34 c.Redirect(http.StatusMovedPermanently, openID.AuthUrl())
35 case "cancel": 35 case "cancel":
36 c.Redirect(http.StatusMovedPermanently, "/") 36 c.Redirect(http.StatusMovedPermanently, "/")
37 default: 37 default:
38 steamID, err := openID.ValidateAndGetId() 38 steamID, err := openID.ValidateAndGetID()
39 if err != nil { 39 if err != nil {
40 CreateLog(steamID, LogTypeUser, LogDescriptionUserLoginFailValidate) 40 CreateLog(steamID, LogTypeUser, LogDescriptionUserLoginFailValidate)
41 c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) 41 c.JSON(http.StatusOK, models.ErrorResponse(err.Error()))
diff --git a/go.mod b/go.mod
index b3852de..ed0ab2a 100644
--- a/go.mod
+++ b/go.mod
@@ -5,12 +5,12 @@ go 1.19
5require ( 5require (
6 github.com/gin-gonic/gin v1.8.1 6 github.com/gin-gonic/gin v1.8.1
7 github.com/joho/godotenv v1.4.0 7 github.com/joho/godotenv v1.4.0
8 github.com/solovev/steam_go v0.0.0-20170222182106-48eb5aae6c50
9) 8)
10 9
11require ( 10require (
12 github.com/golang-jwt/jwt/v4 v4.4.2 11 github.com/golang-jwt/jwt/v4 v4.4.2
13 github.com/google/uuid v1.3.0 12 github.com/google/uuid v1.3.0
13 github.com/pektezol/steam_go v1.1.0
14 github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a 14 github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a
15 github.com/swaggo/gin-swagger v1.5.3 15 github.com/swaggo/gin-swagger v1.5.3
16 github.com/swaggo/swag v1.16.1 16 github.com/swaggo/swag v1.16.1
diff --git a/go.sum b/go.sum
index f5b3907..1cba896 100644
--- a/go.sum
+++ b/go.sum
@@ -129,6 +129,8 @@ github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJ
129github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= 129github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs=
130github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= 130github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo=
131github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= 131github.com/otiai10/mint v1.3.3/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc=
132github.com/pektezol/steam_go v1.1.0 h1:mybEW6bQlSx7oCnKFSo4ZdxvQpNP4vkzyreEKUM5Czg=
133github.com/pektezol/steam_go v1.1.0/go.mod h1:8dk95CLOQKRr0BA8ChnNbTEe0/f2Ibi5O4rmpS9oZCo=
132github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= 134github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
133github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= 135github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg=
134github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= 136github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas=
@@ -143,8 +145,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
143github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= 145github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
144github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= 146github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
145github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= 147github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
146github.com/solovev/steam_go v0.0.0-20170222182106-48eb5aae6c50 h1:5wu+B07+rk5rr6KYxYK+5fRr+m8ikSblPSgDTdrFUE4=
147github.com/solovev/steam_go v0.0.0-20170222182106-48eb5aae6c50/go.mod h1:wDBDgAJlQWhdrpQeJcw6+FZwMddaNWFUo8u8bSfzA50=
148github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 148github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
149github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 149github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
150github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 150github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=