3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Dashboard styling; don't allow login if you have no guild perms; allow logging out

This commit is contained in:
Dragory 2019-07-22 00:11:24 +03:00
parent a517ca3906
commit 0f724fc9bd
9 changed files with 132 additions and 35 deletions

View file

@ -15,8 +15,17 @@ export const authGuard: NavigationGuard = async (to, from, next) => {
};
export const loginCallbackGuard: NavigationGuard = async (to, from, next) => {
await RootStore.dispatch("auth/setApiKey", to.query.apiKey);
next("/dashboard");
if (to.query.apiKey) {
await RootStore.dispatch("auth/setApiKey", to.query.apiKey);
next("/dashboard");
} else {
next({
path: "/",
query: {
error: "noaccess",
},
});
}
};
export const authRedirectGuard: NavigationGuard = async (to, form, next) => {