updated login tokens

This commit is contained in:
2022-12-09 13:04:03 -06:00
parent 8ae527683b
commit 94f3ff9a26
4 changed files with 30 additions and 19 deletions

View File

@@ -24,7 +24,7 @@ func getAuthorization(c *gin.Context) (AuthorizationScope, string) {
return AuthorizationScopeNone, ""
}
if headerSpl[0] == "Bearer" {
if storage.CheckLoginToken(headerSpl[1]) {
if storage.CheckLoginToken(headerSpl[1], c.ClientIP()) {
return AuthorizationScopeUser, headerSpl[1]
}
}

View File

@@ -19,7 +19,7 @@ func login(c *gin.Context) {
return
}
loggedIn, token := storage.CheckLogin(loginBody.Username, loginBody.Password)
loggedIn, token := storage.CheckLogin(loginBody.Username, loginBody.Password, c.ClientIP())
if loggedIn {
c.JSON(200, gin.H{