export default oauth.discordEventHandler({ config: { emailRequired: false, profileRequired: true, scope: ["guilds"], }, async onSuccess(event, { user, tokens }) { console.log(user.username); await setUserSession(event, { user: { username: user.username, }, }); return sendRedirect(event, "/"); }, // Optional, will return a json error and 401 status code by default onError(event, error) { console.error("Discord OAuth error:", error); return sendRedirect(event, "/"); },});
const route = useRoute();const page = ref<number>(0);const category = ref<string>(route.query.category?.toString() || "");const { data: servers, refresh: refreshServers, pending: servers_pending,} = useFetch("/api/v1/stuff/fetch/feed", { query: { page: page.value, category: category.value }, watch: [page, category],});
const route = useRoute();const id = route.params.id;const { data: stuff, pending: stuff_pending } = useFetch( `/api/v1/stuff/fetch/${id}`);