UserRepo fixed oda so
This commit is contained in:
parent
d66b9272b7
commit
2d193969f7
3 changed files with 6 additions and 19 deletions
|
|
@ -1,20 +1,6 @@
|
|||
import {bearerFetch, jwt} from "../models/PomeloUtils";
|
||||
import {StrapiUserRepo} from "../models/repos/user/StrapiUserRepo";
|
||||
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
export async function load() {
|
||||
let invalid = !jwt;
|
||||
|
||||
if (!invalid) {
|
||||
const request = await bearerFetch("/users/me", jwt);
|
||||
const response = await request.json();
|
||||
|
||||
invalid = "error" in response;
|
||||
}
|
||||
|
||||
if (invalid) {
|
||||
if (typeof window !== 'undefined') {
|
||||
// @ts-ignore
|
||||
window.location = "/login";
|
||||
}
|
||||
}
|
||||
// StrapiUserRepo.getInstance();
|
||||
}
|
||||
|
|
@ -74,6 +74,7 @@
|
|||
|
||||
|
||||
<style>
|
||||
@import "src";
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue