diff --git a/components/data/UserData.bs b/components/data/UserData.bs index e20262e0..9a48f756 100644 --- a/components/data/UserData.bs +++ b/components/data/UserData.bs @@ -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 diff --git a/components/data/UserData.xml b/components/data/UserData.xml index 873ca84f..e9efe28d 100644 --- a/components/data/UserData.xml +++ b/components/data/UserData.xml @@ -11,6 +11,5 @@ - \ No newline at end of file diff --git a/source/api/userauth.bs b/source/api/userauth.bs index 41390525..d31623bc 100644 --- a/source/api/userauth.bs +++ b/source/api/userauth.bs @@ -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 diff --git a/source/utils/session.bs b/source/utils/session.bs index d252661b..9bb28bfa 100644 --- a/source/utils/session.bs +++ b/source/utils/session.bs @@ -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