aboutsummaryrefslogtreecommitdiff
path: root/backend/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'backend/handlers')
-rw-r--r--backend/handlers/login.go6
1 files changed, 3 insertions, 3 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()))