Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Otp login #239

Merged
merged 2 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,6 @@
{
"extends": [
"next/core-web-vitals",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
]
}
]
}
15 changes: 7 additions & 8 deletions emails/verification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const siteUrl =

interface VerificationTemplateProps {
userName: string;
verificationUrl: string;
code: string;
}

const VerificationTemp: React.FC<Readonly<VerificationTemplateProps>> = ({
userName,
verificationUrl,
code,
}) => (
<Html>
<Head />
Expand Down Expand Up @@ -51,14 +51,13 @@ const VerificationTemp: React.FC<Readonly<VerificationTemplateProps>> = ({
Click the link below to login to your account.
</Text>
<Section className="mt-8 text-center">
<Button
className="bg-bg-white inline-block rounded-md bg-slate-900 px-6 py-3 text-base text-gray-100"
href={verificationUrl}
<div
className="bg-bg-white inline-block rounded-md bg-slate-900 tracking-wider px-6 py-3 text-base text-gray-100"
>
Sign In
</Button>
{code}
</div>
<Text className="mt-2.5 text-sm ">
This link expires in 3 minutes and can only be used once.
This link expires in 10 minutes and can only be used once.
</Text>
</Section>
<Text className="mt-8 ">
Expand Down
2 changes: 1 addition & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pre-commit:
run: npx tsc --noEmit
lint:
glob: "src/**/*.{ts,tsx,js,jsx}"
run: pnpm eslint {staged_files} --fix && git update-index --again
run: pnpm lint
format:
glob: "src/**/*.{ts,tsx,js,jsx,css}"
run: pnpm prettier --write {staged_files} && git update-index --again
1 change: 1 addition & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const withSerwist = withSerwistInit({
// use something else that works, such as "service-worker/index.ts".
swSrc: "src/app/sw.ts",
swDest: "public/sw.js",
disable: process.env.NODE_ENV !== "production",
});

const nextConfig = {
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@hookform/resolvers": "^3.3.2",
"@lucia-auth/adapter-prisma": "4.0.0-beta.8",
"@lucia-auth/adapter-prisma": "4.0.1",
"@prisma/client": "^5.7.0",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-avatar": "^1.0.4",
Expand All @@ -30,22 +30,23 @@
"@react-email/components": "^0.0.12",
"@serwist/next": "^9.0.3",
"@uploadthing/react": "^6.0.2",
"arctic": "^0.10.2",
"arctic": "^1.9.1",
"dayjs": "^1.11.10",
"lucia": "3.0.0-beta.13",
"input-otp": "^1.2.4",
"lucia": "3.2.0",
"lucide-react": "^0.341.0",
"nanoid": "^5.0.4",
"next": "14.2.2",
"next-international": "^1.1.4",
"next-themes": "^0.2.1",
"oslo": "^0.26.1",
"next-themes": "^0.3.0",
"oslo": "^1.2.1",
"postcss": "8.4.35",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-dropzone": "^14.2.3",
"react-email": "1.10.0",
"react-hook-form": "^7.49.2",
"resend": "^2.1.0-canary.1",
"resend": "^3.4.0",
"stripe": "^14.8.0",
"uploadthing": "^6.1.0",
"zod": "^3.22.4"
Expand All @@ -56,8 +57,6 @@
"@types/node": "20.11.20",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.19",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"autoprefixer": "10.4.16",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
Expand All @@ -75,6 +74,6 @@
"tailwindcss": "3.4.1",
"tailwindcss-animate": "^1.0.7",
"typescript": "5.3.3",
"velite": "0.1.0-rc.3"
"velite": "0.1.0"
}
}
Loading