Spaces:
Sleeping
Sleeping
test cookie
Browse filesFiles changed (2)
123472 unmodified lines777879808182import { NextRequest, NextResponse } from "next/server";export async function GET() {const redirect_uri = process.env.REDIRECT_URI;72 unmodified lines);}const user = await userResponse.json();return NextResponse.json({12345672 unmodified lines79808182838485868788899091import { NextRequest, NextResponse } from "next/server";import { cookies } from "next/headers";import MY_TOKEN_KEY from "@/lib/get-cookie-name";export async function GET() {const redirect_uri = process.env.REDIRECT_URI;72 unmodified lines);}const user = await userResponse.json();const cookieStore = await cookies();cookieStore.set(MY_TOKEN_KEY(), response.access_token, {maxAge: response.expires_in,httpOnly: false,secure: true,sameSite: "none",});return NextResponse.json({
59 unmodified lines6061626364656667686970717259 unmodified lines.post("/auth", { code }).then(async (res: any) => {if (res.data) {setCookie(res.data.access_token, {expires: res.data.expires_in? new Date(Date.now() + res.data.expires_in * 1000): undefined,sameSite: "none",secure: false,});client.setQueryData(["user.me"], {user: res.data.user,errCode: null,59 unmodified lines606162636465666768697071727359 unmodified lines.post("/auth", { code }).then(async (res: any) => {if (res.data) {// fix to be able to set the cookie through the space (Hugging Face)// setCookie(res.data.access_token, {// expires: res.data.expires_in// ? new Date(Date.now() + res.data.expires_in * 1000)// : undefined,// sameSite: "none",// secure: true,// });client.setQueryData(["user.me"], {user: res.data.user,errCode: null,
app/api/auth/route.ts+9
hooks/useUser.ts+8-7