new package dbHandler accesscontrol memeberdb and login with rights
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m20s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m27s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m32s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m28s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m29s
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 2m20s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 5m27s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 5m32s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 5m28s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 5m29s
This commit is contained in:
@@ -18,15 +18,21 @@ export function useLogin() {
|
||||
|
||||
Logo.value = sets.icon;
|
||||
document.documentElement.style.setProperty('--q-primary', sets.primaryColor);
|
||||
document.documentElement.style.setProperty('--q-primary-text', sets.primaryColorText);
|
||||
document.documentElement.style.setProperty('--q-secondary', sets.secondaryColor);
|
||||
document.documentElement.style.setProperty('--q-secondary-text', sets.secondaryColorText);
|
||||
localStorage.setItem('icon', sets.icon);
|
||||
localStorage.setItem('databaseName', sets.databaseName);
|
||||
localStorage.setItem('primaryColor', sets.primaryColor);
|
||||
localStorage.setItem('primaryColorText', sets.primaryColorText);
|
||||
localStorage.setItem('secondaryColor', sets.secondaryColor);
|
||||
localStorage.setItem('secondaryColorText', sets.secondaryColorText);
|
||||
});
|
||||
|
||||
const resp = await appApi.get('/login/me');
|
||||
userStore.setUser({ id: resp.data.id, username: resp.data.user, role: resp.data.role });
|
||||
await userStore
|
||||
.setUser({ id: resp.data.id, username: resp.data.user, role: resp.data.role })
|
||||
.catch((err) => console.log(err));
|
||||
|
||||
startRefreshInterval();
|
||||
return true;
|
||||
@@ -47,12 +53,14 @@ export function useLogin() {
|
||||
|
||||
async function refresh() {
|
||||
await appApi
|
||||
.post('secure/login/refresh', {}, { withCredentials: true })
|
||||
.post('login/refresh', {}, { withCredentials: true })
|
||||
.then(() => {
|
||||
appApi
|
||||
.get('/login/me')
|
||||
.then((resp) => {
|
||||
userStore.setUser({ id: resp.data.id, username: resp.data.user, role: resp.data.role });
|
||||
userStore
|
||||
.setUser({ id: resp.data.id, username: resp.data.user, role: resp.data.role })
|
||||
.catch((err) => console.error(err));
|
||||
if (!intervalId) {
|
||||
startRefreshInterval();
|
||||
}
|
||||
@@ -67,7 +75,7 @@ export function useLogin() {
|
||||
return false;
|
||||
}
|
||||
function getUser() {
|
||||
return userStore.getUser();
|
||||
return userStore.user;
|
||||
}
|
||||
|
||||
function startRefreshInterval() {
|
||||
|
||||
Reference in New Issue
Block a user