15 lines
355 B
TypeScript
15 lines
355 B
TypeScript
import type { GetSession } from '@sveltejs/kit';
|
|
|
|
export const getSession: GetSession = async () => {
|
|
const session: App.Session = {
|
|
instance: { url: 'https://trans.enby.town', token: '' }
|
|
};
|
|
|
|
try {
|
|
const token = window.localStorage.getItem('instance-token') || '';
|
|
session.instance.token = token;
|
|
} catch (_) {}
|
|
|
|
return session;
|
|
};
|