fix: update match configuration to bestOf 5 and scoringType to score_v2
This commit is contained in:
31
.svelte-kit/output/server/entries/pages/demo/_page.svelte.js
Normal file
31
.svelte-kit/output/server/entries/pages/demo/_page.svelte.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { b as attr } from "../../../chunks/index3.js";
|
||||
import { i as initial_base, b as base } from "../../../chunks/server.js";
|
||||
import { r as resolve_route } from "../../../chunks/routing.js";
|
||||
import "../../../chunks/url.js";
|
||||
import { try_get_request_store } from "@sveltejs/kit/internal/server";
|
||||
import "../../../chunks/root.js";
|
||||
function resolve(id, params) {
|
||||
const resolved = resolve_route(
|
||||
id,
|
||||
/** @type {Record<string, string>} */
|
||||
params
|
||||
);
|
||||
{
|
||||
const store = try_get_request_store();
|
||||
if (store && !store.state.prerendering?.fallback) {
|
||||
const after_base = store.event.url.pathname.slice(initial_base.length);
|
||||
const segments = after_base.split("/").slice(2);
|
||||
const prefix = segments.map(() => "..").join("/") || ".";
|
||||
return prefix + resolved;
|
||||
}
|
||||
}
|
||||
return base + resolved;
|
||||
}
|
||||
function _page($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
$$renderer2.push(`<a${attr("href", resolve("/demo/better-auth"))}>better-auth</a>`);
|
||||
});
|
||||
}
|
||||
export {
|
||||
_page as default
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
import { redirect } from "@sveltejs/kit";
|
||||
import { a as auth } from "../../../../chunks/auth.js";
|
||||
const load = async (event) => {
|
||||
if (!event.locals.user) {
|
||||
return redirect(302, "/demo/better-auth/login");
|
||||
}
|
||||
return { user: event.locals.user };
|
||||
};
|
||||
const actions = {
|
||||
signOut: async (event) => {
|
||||
await auth.api.signOut({
|
||||
headers: event.request.headers
|
||||
});
|
||||
return redirect(302, "/demo/better-auth/login");
|
||||
}
|
||||
};
|
||||
export {
|
||||
actions,
|
||||
load
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import { e as escape_html } from "../../../../chunks/index3.js";
|
||||
import "clsx";
|
||||
import "@sveltejs/kit/internal";
|
||||
import "../../../../chunks/url.js";
|
||||
import "../../../../chunks/utils.js";
|
||||
import "@sveltejs/kit/internal/server";
|
||||
import "../../../../chunks/root.js";
|
||||
import "../../../../chunks/exports.js";
|
||||
import "../../../../chunks/state.svelte.js";
|
||||
function _page($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let { data } = $$props;
|
||||
$$renderer2.push(`<h1>Hi, ${escape_html(data.user.name)}!</h1> <p>Your user ID is ${escape_html(data.user.id)}.</p> <form method="post" action="?/signOut"><button class="rounded-md bg-blue-600 px-4 py-2 text-white transition hover:bg-blue-700">Sign out</button></form>`);
|
||||
});
|
||||
}
|
||||
export {
|
||||
_page as default
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
import { redirect, fail } from "@sveltejs/kit";
|
||||
import { a as auth } from "../../../../../chunks/auth.js";
|
||||
import "@better-auth/core/env";
|
||||
import "@better-auth/core/utils";
|
||||
import { APIError } from "better-call";
|
||||
import "@better-auth/core/api";
|
||||
const load = async (event) => {
|
||||
if (event.locals.user) {
|
||||
return redirect(302, "/demo/better-auth");
|
||||
}
|
||||
return {};
|
||||
};
|
||||
const actions = {
|
||||
signInEmail: async (event) => {
|
||||
const formData = await event.request.formData();
|
||||
const email = formData.get("email")?.toString() ?? "";
|
||||
const password = formData.get("password")?.toString() ?? "";
|
||||
try {
|
||||
await auth.api.signInEmail({
|
||||
body: {
|
||||
email,
|
||||
password,
|
||||
callbackURL: "/auth/verification-success"
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
if (error instanceof APIError) {
|
||||
return fail(400, { message: error.message || "Signin failed" });
|
||||
}
|
||||
return fail(500, { message: "Unexpected error" });
|
||||
}
|
||||
return redirect(302, "/demo/better-auth");
|
||||
},
|
||||
signUpEmail: async (event) => {
|
||||
const formData = await event.request.formData();
|
||||
const email = formData.get("email")?.toString() ?? "";
|
||||
const password = formData.get("password")?.toString() ?? "";
|
||||
const name = formData.get("name")?.toString() ?? "";
|
||||
try {
|
||||
await auth.api.signUpEmail({
|
||||
body: {
|
||||
email,
|
||||
password,
|
||||
name,
|
||||
callbackURL: "/auth/verification-success"
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
if (error instanceof APIError) {
|
||||
return fail(400, { message: error.message || "Registration failed" });
|
||||
}
|
||||
return fail(500, { message: "Unexpected error" });
|
||||
}
|
||||
return redirect(302, "/demo/better-auth");
|
||||
},
|
||||
signInSocial: async (event) => {
|
||||
const formData = await event.request.formData();
|
||||
const provider = formData.get("provider")?.toString() ?? "osu";
|
||||
const callbackURL = formData.get("callbackURL")?.toString() ?? "/demo/better-auth";
|
||||
const result = await auth.api.signInSocial({
|
||||
body: {
|
||||
provider,
|
||||
callbackURL
|
||||
}
|
||||
});
|
||||
if (result.url) {
|
||||
return redirect(302, result.url);
|
||||
}
|
||||
return fail(400, { message: "Social sign-in failed" });
|
||||
}
|
||||
};
|
||||
export {
|
||||
actions,
|
||||
load
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import { e as escape_html } from "../../../../../chunks/index3.js";
|
||||
import "clsx";
|
||||
import "@sveltejs/kit/internal";
|
||||
import "../../../../../chunks/url.js";
|
||||
import "../../../../../chunks/utils.js";
|
||||
import "@sveltejs/kit/internal/server";
|
||||
import "../../../../../chunks/root.js";
|
||||
import "../../../../../chunks/exports.js";
|
||||
import "../../../../../chunks/state.svelte.js";
|
||||
function _page($$renderer, $$props) {
|
||||
$$renderer.component(($$renderer2) => {
|
||||
let { form } = $$props;
|
||||
$$renderer2.push(`<h1>Login</h1> <form method="post" action="?/signInEmail"><label>Email <input type="email" name="email" class="mt-1 rounded-md border border-gray-300 bg-white px-3 py-2 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none"/></label> <label>Password <input type="password" name="password" class="mt-1 rounded-md border border-gray-300 bg-white px-3 py-2 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none"/></label> <label>Name (for registration) <input name="name" class="mt-1 rounded-md border border-gray-300 bg-white px-3 py-2 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none"/></label> <button class="rounded-md bg-blue-600 px-4 py-2 text-white transition hover:bg-blue-700">Login</button> <button formaction="?/signUpEmail" class="rounded-md bg-blue-600 px-4 py-2 text-white transition hover:bg-blue-700">Register</button></form> <p class="text-red-500">${escape_html(form?.message ?? "")}</p> <hr class="my-4"/> <form method="post" action="?/signInSocial"><input type="hidden" name="provider" value="osu"/> <input type="hidden" name="callbackURL" value="/demo/better-auth"/> <button class="rounded-md bg-blue-600 px-4 py-2 text-white transition hover:bg-blue-700">Sign in with osu!</button></form>`);
|
||||
});
|
||||
}
|
||||
export {
|
||||
_page as default
|
||||
};
|
||||
Reference in New Issue
Block a user