fixed initial user
Some checks failed
Build and Push Docker Image / Build image (push) Has been cancelled

This commit is contained in:
2025-04-09 03:15:38 +03:00
parent 8747c308e5
commit 8ac960102a
5 changed files with 40 additions and 39 deletions

View File

@@ -110,7 +110,6 @@ func (con AuthApi) signUp(ctx *gin.Context) {
}
err = con.userAuthDbHandler.CreateUser(ctx, request.Username, request.Password, token.Permissions, token.Email, con.config.Users.DefaultMaxOwnedServers)
if err != nil {
ctx.AbortWithError(500, err)
return
@@ -125,10 +124,8 @@ type SignInRequest struct {
}
func (con AuthApi) signIn(ctx *gin.Context) {
var request SignInRequest
err := json.NewDecoder(ctx.Request.Body).Decode(&request)
if err != nil {
ctx.AbortWithError(500, err)
return
@@ -159,13 +156,13 @@ func (con AuthApi) Verify(ctx *gin.Context) {
claimsPointer, exists := ctx.Get("claims")
if !exists {
ctx.Status(403)
ctx.Error(errors.New("Failed to get claims, not logged in"))
ctx.Error(errors.New("failed to get claims, not logged in"))
return
}
claims, ok := claimsPointer.(*AuthClaims)
if !ok {
ctx.Error(errors.New("Failed to convert claims"))
ctx.Error(errors.New("failed to convert claims"))
ctx.Status(500)
return
}