refactor: use shared component for login callback pages

This commit is contained in:
Sam 2023-03-20 15:57:16 +01:00
parent 6d32d05d98
commit 1b949a013d
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
8 changed files with 253 additions and 248 deletions

View file

@ -1,5 +1,6 @@
import { PUBLIC_BASE_URL } from "$env/static/public";
import { apiFetch } from "$lib/api/fetch";
import type { UrlsResponse } from "$lib/api/responses";
export const load = async () => {
const resp = await apiFetch<UrlsResponse>("/auth/urls", {
@ -11,7 +12,3 @@ export const load = async () => {
return { urls: resp };
};
interface UrlsResponse {
discord: string;
}

View file

@ -1,5 +1,6 @@
import { ErrorCode, type APIError } from "$lib/api/entities";
import { apiFetchClient } from "$lib/api/fetch";
import type { ExportResponse } from "$lib/api/responses";
import { error } from "@sveltejs/kit";
export const load = async () => {
@ -12,8 +13,3 @@ export const load = async () => {
throw error((e as APIError).code, (e as APIError).message);
}
};
interface ExportResponse {
path: string;
created_at: string;
}