fixed some inconsistency with verifying client credentials
This commit is contained in:
parent
73afcf6123
commit
596459e4d7
2 changed files with 16 additions and 2 deletions
|
@ -2,12 +2,16 @@ import Post from '$lib/ui/post/Post.svelte';
|
|||
import { Client } from '$lib/client/client.js';
|
||||
import { parsePost } from '$lib/client/api.js';
|
||||
import { get } from 'svelte/store';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
export const ssr = false;
|
||||
|
||||
export async function load({ params }) {
|
||||
let client = get(Client.get());
|
||||
await client.verifyCredentials();
|
||||
|
||||
if (!client.instance || !client.user) {
|
||||
goto("/");
|
||||
}
|
||||
|
||||
const post_id = params.id;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue