1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Full login flow working

Refresh can be faster
This commit is contained in:
Zhiyuan Zheng
2020-11-21 00:40:55 +01:00
parent ab0062e73c
commit 3280663144
27 changed files with 330 additions and 138 deletions

View File

@ -22,8 +22,9 @@ const client = async ({
}
body?: FormData
}): Promise<any> => {
const state: RootState['instanceInfo'] = store.getState().instanceInfo
const url = instanceUrl || store.getState().instanceInfo[instance]
const state: RootState['instances'] = store.getState().instances
const url =
instance === 'remote' ? instanceUrl || state.remote.url : state.local.url
let response
// try {
@ -35,7 +36,7 @@ const client = async ({
'Content-Type': 'application/json',
...headers,
...(instance === 'local' && {
Authorization: `Bearer ${state.localToken}`
Authorization: `Bearer ${state.local.token}`
})
},
...(body && { body: body }),