mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
switching to / for token separator
This commit is contained in:
parent
46dd40ed9c
commit
96d077fd66
@ -31,10 +31,10 @@ export function useLogin() {
|
|||||||
}, [app.state.session]);
|
}, [app.state.session]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (state.password && state.login && !state.enabled && state.login.includes('@')) {
|
if (state.password && state.login && !state.enabled && (state.login.includes('@') || state.login.includes('/'))) {
|
||||||
updateState({ enabled: true });
|
updateState({ enabled: true });
|
||||||
}
|
}
|
||||||
if ((!state.password || !state.login || !state.login.includes('@')) && state.enabled) {
|
if ((!state.password || !state.login || (!state.login.includes('@') && !state.login.includes('/'))) && state.enabled) {
|
||||||
updateState({ enabled: false });
|
updateState({ enabled: false });
|
||||||
}
|
}
|
||||||
}, [state.login, state.password]);
|
}, [state.login, state.password]);
|
||||||
|
@ -139,7 +139,7 @@ export function useAppContext() {
|
|||||||
throw new Error('invalid session state');
|
throw new Error('invalid session state');
|
||||||
}
|
}
|
||||||
updateState({ loggedOut: false });
|
updateState({ loggedOut: false });
|
||||||
const acc = username.split('@');
|
const acc = username.includes('/') ? username.split('/') : username.split('@');
|
||||||
const session = await setLogin(acc[0], acc[1], password, getApplicationName(), getVersion(), getDeviceId(), deviceToken.current, pushType.current, notifications)
|
const session = await setLogin(acc[0], acc[1], password, getApplicationName(), getVersion(), getDeviceId(), deviceToken.current, pushType.current, notifications)
|
||||||
access.current = { loginTimestamp: session.created, server: acc[1], token: session.appToken, guid: session.guid };
|
access.current = { loginTimestamp: session.created, server: acc[1], token: session.appToken, guid: session.guid };
|
||||||
await store.actions.setSession(access.current);
|
await store.actions.setSession(access.current);
|
||||||
|
Loading…
Reference in New Issue
Block a user