reworked html serving, added new permissions for api/auth, updated adapters

This commit is contained in:
dswbx
2024-11-23 11:21:09 +01:00
parent 6077f0e64f
commit 2433833ad0
30 changed files with 418 additions and 298 deletions

View File

@@ -50,14 +50,18 @@ export class AppQueryClient {
return this.api.getAuthState();
},
verify: async () => {
console.log("verifiying");
const res = await this.api.auth.me();
console.log("verifying result", res);
if (!res.res.ok) {
try {
//console.log("verifiying");
const res = await this.api.auth.me();
//console.log("verifying result", res);
if (!res.res.ok || !res.body.user) {
throw new Error();
}
this.api.markAuthVerified(true);
} catch (e) {
this.api.markAuthVerified(false);
this.api.updateToken(undefined);
} else {
this.api.markAuthVerified(true);
}
}
};