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

dashboard: auth fixes, guild listing, config editing

This commit is contained in:
Dragory 2019-06-23 03:40:53 +03:00
parent 1dae3019c4
commit 7bda2b1763
14 changed files with 200 additions and 42 deletions

View file

@ -16,11 +16,11 @@ export const AuthStore: Module<AuthState, RootState> = {
const storedKey = localStorage.getItem("apiKey");
if (storedKey) {
console.log("key?", storedKey);
const result = await post("auth/validate-key", { key: storedKey });
if (result.isValid) {
if (result.valid) {
await dispatch("setApiKey", storedKey);
} else {
console.log("Unable to validate key, removing from localStorage");
localStorage.removeItem("apiKey");
}
}