mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 20:49:16 +00:00
request push permission on all login paths
This commit is contained in:
parent
76461b7c29
commit
17eb18ce6a
@ -86,20 +86,26 @@ export function useAppContext() {
|
|||||||
const access = await setLogin(username, server, password, getApplicatioName(), getVersion(), getDeviceId(), state.deviceToken, notifications)
|
const access = await setLogin(username, server, password, getApplicatioName(), getVersion(), getDeviceId(), state.deviceToken, notifications)
|
||||||
await store.actions.setSession({ ...access, server});
|
await store.actions.setSession({ ...access, server});
|
||||||
await setSession({ ...access, server });
|
await setSession({ ...access, server });
|
||||||
|
if (access.pushSupported) {
|
||||||
|
messaging().requestPermission().then(status => {})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
access: async (server, token) => {
|
access: async (server, token) => {
|
||||||
const access = await setAccountAccess(server, token, getApplicationName(), getVersion(), getDeviceId(), state.deviceToken, notifications);
|
const access = await setAccountAccess(server, token, getApplicationName(), getVersion(), getDeviceId(), state.deviceToken, notifications);
|
||||||
await store.actions.setSession({ ...access, server});
|
await store.actions.setSession({ ...access, server});
|
||||||
await setSession({ ...access, server });
|
await setSession({ ...access, server });
|
||||||
|
if (access.pushSupported) {
|
||||||
|
messaging().requestPermission().then(status => {})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
login: async (username, password) => {
|
login: async (username, password) => {
|
||||||
const acc = username.split('@');
|
const acc = username.split('@');
|
||||||
const access = await setLogin(acc[0], acc[1], password, getApplicationName(), getVersion(), getDeviceId(), state.deviceToken, notifications)
|
const access = await setLogin(acc[0], acc[1], password, getApplicationName(), getVersion(), getDeviceId(), state.deviceToken, notifications)
|
||||||
|
await store.actions.setSession({ ...access, server: acc[1]});
|
||||||
|
await setSession({ ...access, server: acc[1] });
|
||||||
if (access.pushSupported) {
|
if (access.pushSupported) {
|
||||||
messaging().requestPermission().then(status => {})
|
messaging().requestPermission().then(status => {})
|
||||||
}
|
}
|
||||||
await store.actions.setSession({ ...access, server: acc[1]});
|
|
||||||
await setSession({ ...access, server: acc[1] });
|
|
||||||
},
|
},
|
||||||
logout: async () => {
|
logout: async () => {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user