Save username and password after successful auth
This commit is contained in:
parent
593a017c78
commit
c36350a593
|
@ -111,11 +111,18 @@ function CreateSigninGroup(user = "")
|
|||
username_field.label = tr("Username")
|
||||
username_field.field = "username"
|
||||
username_field.type = "string"
|
||||
username_field.value = user
|
||||
if user = "" and get_setting("username") <> invalid
|
||||
username_field.value = get_setting("username")
|
||||
else
|
||||
username_field.value = user
|
||||
end if
|
||||
password_field = CreateObject("roSGNode", "ConfigData")
|
||||
password_field.label = tr("Password")
|
||||
password_field.field = "password"
|
||||
password_field.type = "password"
|
||||
if get_setting("password") <> invalid
|
||||
password_field.value = get_setting("password")
|
||||
end if
|
||||
items = [ username_field, password_field ]
|
||||
config.configItems = items
|
||||
|
||||
|
@ -143,7 +150,11 @@ function CreateSigninGroup(user = "")
|
|||
if node = "submit"
|
||||
' Validate credentials
|
||||
get_token(username.value, password.value)
|
||||
if get_setting("active_user") <> invalid then return "true"
|
||||
if get_setting("active_user") <> invalid
|
||||
set_setting("username", username.value)
|
||||
set_setting("password", password.value)
|
||||
return "true"
|
||||
end if
|
||||
print "Login attempt failed..."
|
||||
group.findNode("alert").text = tr("Login attempt failed.")
|
||||
end if
|
||||
|
|
Loading…
Reference in New Issue
Block a user