Merge pull request #1532 from cewert/fix-remember-me
Fix remember me bug
This commit is contained in:
commit
5904f0593f
|
@ -53,12 +53,6 @@ function setPreference(key as string, value as string)
|
|||
return set_user_setting("pref-" + key, value)
|
||||
end function
|
||||
|
||||
sub setActive()
|
||||
if m.global.session.user.settings["global.rememberme"]
|
||||
set_setting("active_user", m.top.id)
|
||||
end if
|
||||
end sub
|
||||
|
||||
sub setServer(hostname as string)
|
||||
m.top.server = hostname
|
||||
end sub
|
||||
|
|
|
@ -11,6 +11,5 @@
|
|||
<function name="setPreference" />
|
||||
<function name="loadFromRegistry" />
|
||||
<function name="saveToRegistry" />
|
||||
<function name="setActive" />
|
||||
</interface>
|
||||
</component>
|
|
@ -12,9 +12,8 @@ function get_token(user as string, password as string)
|
|||
|
||||
userdata = CreateObject("roSGNode", "UserData")
|
||||
userdata.json = json
|
||||
|
||||
userdata.callFunc("setActive")
|
||||
userdata.callFunc("saveToRegistry")
|
||||
|
||||
return userdata
|
||||
end function
|
||||
|
||||
|
@ -163,8 +162,8 @@ function AuthenticateViaQuickConnect(secret)
|
|||
userdata.json = jsonResponse
|
||||
session.user.Update("id", jsonResponse.User.Id)
|
||||
session.user.Update("authToken", jsonResponse.AccessToken)
|
||||
userdata.callFunc("setActive")
|
||||
userdata.callFunc("saveToRegistry")
|
||||
|
||||
return true
|
||||
end if
|
||||
|
||||
|
|
|
@ -183,6 +183,10 @@ namespace session
|
|||
set_user_setting("username", tmpSession.user.name)
|
||||
end if
|
||||
|
||||
if m.global.session.user.settings["global.rememberme"]
|
||||
set_setting("active_user", tmpSession.user.id)
|
||||
end if
|
||||
|
||||
session.user.LoadUserPreferences()
|
||||
end sub
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user