updated login tokens
This commit is contained in:
@@ -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]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user