-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5fd24b
commit eed2b6e
Showing
63 changed files
with
1,230 additions
and
818 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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.next | ||
.vscode | ||
**/*.html | ||
supabase |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"endOfLine": "lf", | ||
"semi": false, | ||
"singleQuote": false, | ||
"tabWidth": 2, | ||
"trailingComma": "es5", | ||
"importOrder": [ | ||
"^(react/(.*)$)|^(react$)", | ||
"^(next/(.*)$)|^(next$)", | ||
"<THIRD_PARTY_MODULES>", | ||
"", | ||
"^@/lib/(.*)$", | ||
"^@/components/ui/(.*)$", | ||
"^@/components/(.*)$", | ||
"^@/styles/(.*)$", | ||
"^@/app/(.*)$", | ||
"", | ||
"^@/modules/types(.*)$", | ||
"^@/modules/utils(.*)$", | ||
"^@/modules(.*)$", | ||
"", | ||
"^[./]" | ||
], | ||
"importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"], | ||
"plugins": [ | ||
"@ianvs/prettier-plugin-sort-imports", | ||
"prettier-plugin-tailwindcss" | ||
], | ||
"tailwindConfig": "tailwind.config.ts", | ||
"tailwindFunctions": ["cn", "cva"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["dbaeumer.vscode-eslint"] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "always" | ||
}, | ||
"editor.formatOnSave": true, | ||
"eslint.rules.customizations": [ | ||
{ | ||
"rule": "*", | ||
"severity": "warn" | ||
} | ||
], | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} |
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,32 +1,33 @@ | ||
import { createClient } from "@/modules/utils/server"; | ||
import { type EmailOtpType } from "@supabase/supabase-js"; | ||
import { type NextRequest, NextResponse } from "next/server"; | ||
import { NextResponse, type NextRequest } from "next/server" | ||
import { type EmailOtpType } from "@supabase/supabase-js" | ||
|
||
import { createClient } from "@/modules/utils/server" | ||
|
||
export async function GET(request: NextRequest) { | ||
const { searchParams } = new URL(request.url); | ||
const token_hash = searchParams.get("token_hash"); | ||
const type = searchParams.get("type") as EmailOtpType | null; | ||
const next = searchParams.get("next") ?? "/"; | ||
const { searchParams } = new URL(request.url) | ||
const token_hash = searchParams.get("token_hash") | ||
const type = searchParams.get("type") as EmailOtpType | null | ||
const next = searchParams.get("next") ?? "/" | ||
|
||
const redirectTo = request.nextUrl.clone(); | ||
redirectTo.pathname = next; | ||
redirectTo.searchParams.delete("token_hash"); | ||
redirectTo.searchParams.delete("type"); | ||
const redirectTo = request.nextUrl.clone() | ||
redirectTo.pathname = next | ||
redirectTo.searchParams.delete("token_hash") | ||
redirectTo.searchParams.delete("type") | ||
|
||
if (token_hash && type) { | ||
const supabase = createClient(); | ||
const supabase = createClient() | ||
|
||
const { error } = await supabase.auth.verifyOtp({ | ||
type, | ||
token_hash, | ||
}); | ||
}) | ||
|
||
if (!error) { | ||
redirectTo.searchParams.delete("next"); | ||
return NextResponse.redirect(redirectTo); | ||
redirectTo.searchParams.delete("next") | ||
return NextResponse.redirect(redirectTo) | ||
} | ||
} | ||
|
||
redirectTo.pathname = "/"; | ||
return NextResponse.redirect(redirectTo); | ||
redirectTo.pathname = "/" | ||
return NextResponse.redirect(redirectTo) | ||
} |
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,10 +1,10 @@ | ||
import { DynamicBreadCrumbs } from "@/components/dynamic-breadcrumbs"; | ||
import { DynamicBreadCrumbs } from "@/components/dynamic-breadcrumbs" | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<section className="mx-auto max-w-lg space-y-2 py-12"> | ||
<DynamicBreadCrumbs /> | ||
{children} | ||
</section> | ||
); | ||
) | ||
} |
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,17 +1,19 @@ | ||
import { createClient } from "@/modules/utils/server"; | ||
import { redirect } from "next/navigation"; | ||
import { RegisterForm } from "@/components/user/register-form"; | ||
import { redirect } from "next/navigation" | ||
|
||
import { RegisterForm } from "@/components/user/register-form" | ||
|
||
import { createClient } from "@/modules/utils/server" | ||
|
||
export default async function Page() { | ||
const supabase = createClient(); | ||
const supabase = createClient() | ||
|
||
const { | ||
data: { user }, | ||
} = await supabase.auth.getUser(); | ||
} = await supabase.auth.getUser() | ||
|
||
if (user) { | ||
redirect("/settings/accounts"); | ||
redirect("/settings/accounts") | ||
} | ||
|
||
return <RegisterForm />; | ||
return <RegisterForm /> | ||
} |
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,36 +1,38 @@ | ||
import { createClient } from "@/modules/utils/server"; | ||
import { OtpLoginForm } from "@/components/user/otp-login-form"; | ||
import { redirect } from "next/navigation"; | ||
import { z } from "zod"; | ||
import { redirect } from "next/navigation" | ||
import { z } from "zod" | ||
|
||
import { OtpLoginForm } from "@/components/user/otp-login-form" | ||
|
||
import { createClient } from "@/modules/utils/server" | ||
|
||
const emailSchema = z.object({ | ||
email: z.string().email(), | ||
}); | ||
}) | ||
|
||
export default async function Page({ | ||
searchParams, | ||
}: { | ||
searchParams: { email?: string }; | ||
searchParams: { email?: string } | ||
}) { | ||
const supabase = createClient(); | ||
const supabase = createClient() | ||
|
||
const { | ||
data: { user }, | ||
} = await supabase.auth.getUser(); | ||
} = await supabase.auth.getUser() | ||
|
||
if (user) { | ||
redirect("/settings/accounts"); | ||
redirect("/settings/accounts") | ||
} | ||
|
||
if (!searchParams.email) { | ||
redirect("/login"); | ||
redirect("/login") | ||
} | ||
|
||
const res = emailSchema.safeParse({ email: searchParams.email }); | ||
const res = emailSchema.safeParse({ email: searchParams.email }) | ||
|
||
if (!res.success) { | ||
redirect("/login"); | ||
redirect("/login") | ||
} | ||
|
||
return <OtpLoginForm email={searchParams.email} />; | ||
return <OtpLoginForm email={searchParams.email} /> | ||
} |
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,17 +1,19 @@ | ||
import { createClient } from "@/modules/utils/server"; | ||
import { LoginForm } from "@/components/user/login-form"; | ||
import { redirect } from "next/navigation"; | ||
import { redirect } from "next/navigation" | ||
|
||
import { LoginForm } from "@/components/user/login-form" | ||
|
||
import { createClient } from "@/modules/utils/server" | ||
|
||
export default async function Page() { | ||
const supabase = createClient(); | ||
const supabase = createClient() | ||
|
||
const { | ||
data: { user }, | ||
} = await supabase.auth.getUser(); | ||
} = await supabase.auth.getUser() | ||
|
||
if (user) { | ||
redirect("/settings/accounts"); | ||
redirect("/settings/accounts") | ||
} | ||
|
||
return <LoginForm />; | ||
return <LoginForm /> | ||
} |
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,17 +1,19 @@ | ||
import { createClient } from "@/modules/utils/server"; | ||
import { NewResetPasswordForm } from "@/components/user/new-reset-password-form"; | ||
import { redirect } from "next/navigation"; | ||
import { redirect } from "next/navigation" | ||
|
||
import { NewResetPasswordForm } from "@/components/user/new-reset-password-form" | ||
|
||
import { createClient } from "@/modules/utils/server" | ||
|
||
export default async function Page() { | ||
const supabase = createClient(); | ||
const supabase = createClient() | ||
|
||
const { | ||
data: { user }, | ||
} = await supabase.auth.getUser(); | ||
} = await supabase.auth.getUser() | ||
|
||
if (!user) { | ||
redirect("/login"); | ||
redirect("/login") | ||
} | ||
|
||
return <NewResetPasswordForm />; | ||
return <NewResetPasswordForm /> | ||
} |
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,17 +1,19 @@ | ||
import { createClient } from "@/modules/utils/server"; | ||
import { redirect } from "next/navigation"; | ||
import { ResetPasswordForm } from "@/components/user/reset-password-form"; | ||
import { redirect } from "next/navigation" | ||
|
||
import { ResetPasswordForm } from "@/components/user/reset-password-form" | ||
|
||
import { createClient } from "@/modules/utils/server" | ||
|
||
export default async function Page() { | ||
const supabase = createClient(); | ||
const supabase = createClient() | ||
|
||
const { | ||
data: { user }, | ||
} = await supabase.auth.getUser(); | ||
} = await supabase.auth.getUser() | ||
|
||
if (user) { | ||
redirect("/settings/accounts"); | ||
redirect("/settings/accounts") | ||
} | ||
|
||
return <ResetPasswordForm />; | ||
return <ResetPasswordForm /> | ||
} |
Oops, something went wrong.