Skip to content

Commit

Permalink
fix(authentication): fixed authentication denial when authentication …
Browse files Browse the repository at this point in the history
…is disabled as per settings
  • Loading branch information
Will Moss committed Jan 12, 2024
1 parent 68a0860 commit 72b3124
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/server/server/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ func (Authentication) RunCommand(server *Server, session *melody.Session, comman

// Command : Authenticate the client by password
case "auth.login":
if _os.GetEnv("AUTHENTICATION_ENABLED") != "TRUE" {
session.Set("authenticated", true)
server.SendNotification(session, ui.NotificationAuth(ui.NP{
Type: ui.TypeSuccess,
Content: ui.JSON{
"Authentication": ui.JSON{
"Message": "Your are now authenticated",
},
},
}),
)
break
}

password := command.Args["Password"]

if password != _os.GetEnv("AUTHENTICATION_SECRET") {
Expand Down

0 comments on commit 72b3124

Please sign in to comment.