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