Remove password after login, if necessary
parent
e8c0df004e
commit
b465ad1f47
|
@ -190,6 +190,7 @@ loginWithUsernameAndPasswordV1 { username, password } =
|
|||
, refresh = out.refreshToken
|
||||
, value = out.accessToken
|
||||
}
|
||||
, E.RemovePasswordIfNecessary
|
||||
, out.user
|
||||
|> Maybe.map (V.SetUser >> E.ContentUpdate)
|
||||
|> E.Optional
|
||||
|
|
|
@ -78,6 +78,7 @@ type EnvelopeUpdate a
|
|||
| More (List (EnvelopeUpdate a))
|
||||
| Optional (Maybe (EnvelopeUpdate a))
|
||||
| RemoveAccessToken String
|
||||
| RemovePasswordIfNecessary
|
||||
| SetAccessToken AccessToken
|
||||
| SetBaseUrl String
|
||||
| SetDeviceId String
|
||||
|
@ -311,6 +312,13 @@ update updateContent eu ({ context } as data) =
|
|||
RemoveAccessToken token ->
|
||||
{ data | context = { context | accessTokens = Hashdict.removeKey token context.accessTokens } }
|
||||
|
||||
RemovePasswordIfNecessary ->
|
||||
if data.settings.removePasswordOnLogin then
|
||||
{ data | context = { context | password = Nothing } }
|
||||
|
||||
else
|
||||
data
|
||||
|
||||
SetAccessToken a ->
|
||||
{ data | context = { context | accessTokens = Hashdict.insert a context.accessTokens } }
|
||||
|
||||
|
|
Loading…
Reference in New Issue