Force access token on account data + fix bug
parent
bc2d1a183b
commit
f18dbcc941
|
@ -29,7 +29,8 @@ setAccountDataV1 { content, eventType, roomId } context =
|
||||||
R.callApi "PUT" "/_matrix/client/r0/user/{userId}/account_data/{type}"
|
R.callApi "PUT" "/_matrix/client/r0/user/{userId}/account_data/{type}"
|
||||||
)
|
)
|
||||||
>> R.withAttributes
|
>> R.withAttributes
|
||||||
[ R.replaceInUrl "type" eventType
|
[ R.accessToken
|
||||||
|
, R.replaceInUrl "type" eventType
|
||||||
, R.replaceInUrl "userId" (Context.getUserId context)
|
, R.replaceInUrl "userId" (Context.getUserId context)
|
||||||
, R.fullBody content
|
, R.fullBody content
|
||||||
]
|
]
|
||||||
|
@ -48,7 +49,8 @@ setAccountDataV2 { content, eventType, roomId } context =
|
||||||
R.callApi "PUT" "/_matrix/client/v3/user/{userId}/account_data/{type}"
|
R.callApi "PUT" "/_matrix/client/v3/user/{userId}/account_data/{type}"
|
||||||
)
|
)
|
||||||
>> R.withAttributes
|
>> R.withAttributes
|
||||||
[ R.replaceInUrl "type" eventType
|
[ R.accessToken
|
||||||
|
, R.replaceInUrl "type" eventType
|
||||||
, R.replaceInUrl "userId" (Context.getUserId context)
|
, R.replaceInUrl "userId" (Context.getUserId context)
|
||||||
, R.fullBody content
|
, R.fullBody content
|
||||||
]
|
]
|
||||||
|
|
|
@ -334,6 +334,9 @@ updateWith vaultUpdate ((Vault ({ cred, context } as data)) as vault) =
|
||||||
LoggedInWithUsernameAndPassword _ output ->
|
LoggedInWithUsernameAndPassword _ output ->
|
||||||
Vault { data | context = Credentials.addToken output.accessToken context }
|
Vault { data | context = Credentials.addToken output.accessToken context }
|
||||||
|
|
||||||
|
getUsername : Vault -> Maybe String
|
||||||
|
getUsername (Vault { context }) =
|
||||||
|
Credentials.getUserId context
|
||||||
|
|
||||||
{-| Set personal account data
|
{-| Set personal account data
|
||||||
-}
|
-}
|
||||||
|
|
Loading…
Reference in New Issue