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