-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lil change in test api | npm run pretty
- Loading branch information
1 parent
46e97ce
commit a6008d7
Showing
78 changed files
with
3,342 additions
and
2,548 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ | |
"utils": "@/lib/utils", | ||
"components": "@/components" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
const nextConfig = {}; | ||
|
||
export default nextConfig; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import {NextRequest, NextResponse} from "next/server"; | ||
import {createClient} from "@/utils/supabase/server"; | ||
import { NextRequest, NextResponse } from "next/server"; | ||
import { createClient } from "@/utils/supabase/server"; | ||
|
||
export async function GET(req: NextRequest) { | ||
const supabase = createClient() | ||
const supabase = createClient(); | ||
|
||
const { error } = await supabase.auth.signOut() | ||
const { error } = await supabase.auth.signOut(); | ||
|
||
if (error) { | ||
return NextResponse.json({ error: error.message }, { status: 500 }); | ||
} | ||
|
||
return NextResponse.json({ data: 'Logout successful' }, { status: 200 }); | ||
} | ||
return NextResponse.json({ data: "Logout successful" }, { status: 200 }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
import {NextRequest, NextResponse} from "next/server"; | ||
import { cookies } from 'next/headers'; | ||
import {createClient} from "@/utils/supabase/server"; | ||
import { NextRequest, NextResponse } from "next/server"; | ||
import { cookies } from "next/headers"; | ||
import { createClient } from "@/utils/supabase/server"; | ||
|
||
export async function GET(req: NextRequest) { | ||
const requestUrl = new URL(req.nextUrl.href) | ||
const code = requestUrl.searchParams.get('code') | ||
const requestUrl = new URL(req.nextUrl.href); | ||
const code = requestUrl.searchParams.get("code"); | ||
|
||
if( code ) { | ||
const supabase = createClient() | ||
const { error } = await supabase.auth.exchangeCodeForSession(code) | ||
if (code) { | ||
const supabase = createClient(); | ||
const { error } = await supabase.auth.exchangeCodeForSession(code); | ||
|
||
return NextResponse.redirect(new URL(`${req.nextUrl.origin}/auth/update_password`, req.nextUrl.href)) | ||
return NextResponse.redirect( | ||
new URL(`${req.nextUrl.origin}/auth/update_password`, req.nextUrl.href), | ||
); | ||
} | ||
|
||
console.log({error : 'ERROR: Invalid auth code or no auth code found'}, { status: 500 }) | ||
console.log( | ||
{ error: "ERROR: Invalid auth code or no auth code found" }, | ||
{ status: 500 }, | ||
); | ||
|
||
return NextResponse.redirect(new URL(`${req.nextUrl.origin}/auth`, req.nextUrl.href)) | ||
} | ||
return NextResponse.redirect( | ||
new URL(`${req.nextUrl.origin}/auth`, req.nextUrl.href), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.