mirror of
https://github.com/balzack/databag.git
synced 2025-02-11 19:19: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]);
|
||||
|
||||
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 });
|
||||
}
|
||||
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 });
|
||||
}
|
||||
}, [state.login, state.password]);
|
||||
|
@ -139,7 +139,7 @@ export function useAppContext() {
|
||||
throw new Error('invalid session state');
|
||||
}
|
||||
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)
|
||||
access.current = { loginTimestamp: session.created, server: acc[1], token: session.appToken, guid: session.guid };
|
||||
await store.actions.setSession(access.current);
|
||||
|
Loading…
Reference in New Issue
Block a user