@digilogiclabs/create-saas-app 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/commands/add.d.ts +6 -0
- package/dist/cli/commands/add.d.ts.map +1 -0
- package/dist/cli/commands/add.js +39 -0
- package/dist/cli/commands/add.js.map +1 -0
- package/dist/cli/commands/create.d.ts +28 -0
- package/dist/cli/commands/create.d.ts.map +1 -0
- package/dist/cli/commands/create.js +130 -0
- package/dist/cli/commands/create.js.map +1 -0
- package/dist/cli/commands/index.d.ts +4 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +20 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/update.d.ts +6 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +68 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/{index.d.ts → cli/index.d.ts} +2 -3
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +59 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/prompts/index.d.ts +2 -0
- package/dist/cli/prompts/index.d.ts.map +1 -0
- package/dist/cli/prompts/index.js +18 -0
- package/dist/cli/prompts/index.js.map +1 -0
- package/dist/cli/prompts/project-setup.d.ts +5 -0
- package/dist/cli/prompts/project-setup.d.ts.map +1 -0
- package/dist/cli/prompts/project-setup.js +251 -0
- package/dist/cli/prompts/project-setup.js.map +1 -0
- package/dist/cli/utils/git.d.ts +9 -0
- package/dist/cli/utils/git.d.ts.map +1 -0
- package/dist/cli/utils/git.js +77 -0
- package/dist/cli/utils/git.js.map +1 -0
- package/dist/cli/utils/index.d.ts +5 -0
- package/dist/cli/utils/index.d.ts.map +1 -0
- package/dist/cli/utils/index.js +21 -0
- package/dist/cli/utils/index.js.map +1 -0
- package/dist/cli/utils/logger.d.ts +16 -0
- package/dist/cli/utils/logger.d.ts.map +1 -0
- package/dist/cli/utils/logger.js +55 -0
- package/dist/cli/utils/logger.js.map +1 -0
- package/dist/cli/utils/package-manager.d.ts +8 -0
- package/dist/cli/utils/package-manager.d.ts.map +1 -0
- package/dist/cli/utils/package-manager.js +92 -0
- package/dist/cli/utils/package-manager.js.map +1 -0
- package/dist/cli/utils/spinner.d.ts +7 -0
- package/dist/cli/utils/spinner.d.ts.map +1 -0
- package/dist/cli/utils/spinner.js +48 -0
- package/dist/cli/utils/spinner.js.map +1 -0
- package/dist/cli/validators/dependencies.d.ts +15 -0
- package/dist/cli/validators/dependencies.d.ts.map +1 -0
- package/dist/cli/validators/dependencies.js +108 -0
- package/dist/cli/validators/dependencies.js.map +1 -0
- package/dist/cli/validators/index.d.ts +3 -0
- package/dist/cli/validators/index.d.ts.map +1 -0
- package/dist/cli/validators/index.js +19 -0
- package/dist/cli/validators/index.js.map +1 -0
- package/dist/cli/validators/project-name.d.ts +5 -0
- package/dist/cli/validators/project-name.d.ts.map +1 -0
- package/dist/cli/validators/project-name.js +151 -0
- package/dist/cli/validators/project-name.js.map +1 -0
- package/dist/generators/file-processor.d.ts +28 -0
- package/dist/generators/file-processor.d.ts.map +1 -0
- package/dist/generators/file-processor.js +203 -0
- package/dist/generators/file-processor.js.map +1 -0
- package/dist/generators/index.d.ts +4 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +20 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/package-installer.d.ts +29 -0
- package/dist/generators/package-installer.d.ts.map +1 -0
- package/dist/generators/package-installer.js +167 -0
- package/dist/generators/package-installer.js.map +1 -0
- package/dist/generators/template-generator.d.ts +48 -0
- package/dist/generators/template-generator.d.ts.map +1 -0
- package/dist/generators/template-generator.js +276 -0
- package/dist/generators/template-generator.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/templates/web/ui-auth-payments/template/package-lock.json +12240 -0
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +1 -1
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +3 -3
- package/src/templates/web/ui-auth-payments/template/tsconfig.tsbuildinfo +1 -0
- package/src/templates/web/ui-auth-payments-audio/template/package-lock.json +12241 -0
- package/src/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +2 -105
- package/src/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +2 -124
- package/{dist/templates/web/ui-auth-payments → src/templates/web/ui-auth-payments-audio}/template/src/components/client/login-form.tsx +1 -1
- package/{dist/templates/web/ui-auth-payments → src/templates/web/ui-auth-payments-audio}/template/src/components/client/signup-form.tsx +3 -3
- package/src/templates/web/ui-auth-payments-audio/template/src/lib/actions/index.ts +14 -0
- package/src/templates/web/ui-auth-payments-audio/template/tsconfig.tsbuildinfo +1 -0
- package/dist/templates/mobile/base/template/.env.example +0 -15
- package/dist/templates/mobile/base/template/App.tsx +0 -88
- package/dist/templates/mobile/base/template/app/(auth)/login.tsx +0 -44
- package/dist/templates/mobile/base/template/app/(auth)/signup.tsx +0 -43
- package/dist/templates/mobile/base/template/app/checkout.tsx +0 -20
- package/dist/templates/mobile/base/template/package.json +0 -38
- package/dist/templates/shared/auth/firebase/web/config.ts +0 -23
- package/dist/templates/shared/auth/supabase/web/config.ts +0 -8
- package/dist/templates/web/base/template/.env.example +0 -15
- package/dist/templates/web/base/template/.eslintrc.js +0 -8
- package/dist/templates/web/base/template/README.md +0 -68
- package/dist/templates/web/base/template/next.config.js +0 -15
- package/dist/templates/web/base/template/package.json +0 -58
- package/dist/templates/web/base/template/postcss.config.js +0 -7
- package/dist/templates/web/base/template/src/app/auth/callback/route.ts +0 -18
- package/dist/templates/web/base/template/src/app/checkout/page.tsx +0 -28
- package/dist/templates/web/base/template/src/app/error.tsx +0 -97
- package/dist/templates/web/base/template/src/app/globals.css +0 -60
- package/dist/templates/web/base/template/src/app/layout.tsx +0 -35
- package/dist/templates/web/base/template/src/app/loading.tsx +0 -34
- package/dist/templates/web/base/template/src/app/login/page.tsx +0 -39
- package/dist/templates/web/base/template/src/app/page.tsx +0 -132
- package/dist/templates/web/base/template/src/app/signup/page.tsx +0 -39
- package/dist/templates/web/base/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/base/template/src/components/providers/app-providers.tsx +0 -33
- package/dist/templates/web/base/template/src/components/providers/theme-provider.tsx +0 -94
- package/dist/templates/web/base/template/src/components/shared/footer.tsx +0 -36
- package/dist/templates/web/base/template/src/components/shared/header.tsx +0 -44
- package/dist/templates/web/base/template/src/components/ui/badge.tsx +0 -36
- package/dist/templates/web/base/template/src/components/ui/button.tsx +0 -56
- package/dist/templates/web/base/template/src/components/ui/card.tsx +0 -71
- package/dist/templates/web/base/template/src/components/ui/theme-toggle.tsx +0 -34
- package/dist/templates/web/base/template/src/lib/env.ts +0 -46
- package/dist/templates/web/base/template/src/lib/utils.ts +0 -140
- package/dist/templates/web/base/template/src/test/setup.ts +0 -79
- package/dist/templates/web/base/template/tailwind.config.js +0 -77
- package/dist/templates/web/base/template/tsconfig.json +0 -33
- package/dist/templates/web/base/template/vitest.config.ts +0 -17
- package/dist/templates/web/base/template.backup/.env.example +0 -15
- package/dist/templates/web/base/template.backup.20250817/.env.example +0 -15
- package/dist/templates/web/ui-auth/template/.env.example +0 -15
- package/dist/templates/web/ui-auth/template/.eslintrc.js +0 -8
- package/dist/templates/web/ui-auth/template/README.md +0 -68
- package/dist/templates/web/ui-auth/template/next.config.js +0 -12
- package/dist/templates/web/ui-auth/template/package.json +0 -50
- package/dist/templates/web/ui-auth/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth/template/src/app/auth/callback/route.ts +0 -12
- package/dist/templates/web/ui-auth/template/src/app/checkout/page.tsx +0 -25
- package/dist/templates/web/ui-auth/template/src/app/error.tsx +0 -67
- package/dist/templates/web/ui-auth/template/src/app/globals.css +0 -42
- package/dist/templates/web/ui-auth/template/src/app/layout.tsx +0 -33
- package/dist/templates/web/ui-auth/template/src/app/loading.tsx +0 -20
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +0 -109
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +0 -129
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +0 -128
- package/dist/templates/web/ui-auth/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth/template/src/components/providers/app-providers.tsx +0 -29
- package/dist/templates/web/ui-auth/template/src/components/providers/theme-provider.tsx +0 -94
- package/dist/templates/web/ui-auth/template/src/components/shared/footer.tsx +0 -36
- package/dist/templates/web/ui-auth/template/src/components/shared/header.tsx +0 -53
- package/dist/templates/web/ui-auth/template/src/components/ui/badge.tsx +0 -36
- package/dist/templates/web/ui-auth/template/src/components/ui/theme-toggle.tsx +0 -34
- package/dist/templates/web/ui-auth/template/src/lib/env.ts +0 -49
- package/dist/templates/web/ui-auth/template/src/lib/utils.ts +0 -140
- package/dist/templates/web/ui-auth/template/src/test/setup.ts +0 -79
- package/dist/templates/web/ui-auth/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth/template/tsconfig.json +0 -33
- package/dist/templates/web/ui-auth/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth/template.backup/.env.example +0 -15
- package/dist/templates/web/ui-auth/template.backup.20250817/.env.example +0 -15
- package/dist/templates/web/ui-auth-payments/template/.env.example +0 -15
- package/dist/templates/web/ui-auth-payments/template/README.md +0 -165
- package/dist/templates/web/ui-auth-payments/template/next.config.js +0 -12
- package/dist/templates/web/ui-auth-payments/template/package.json +0 -52
- package/dist/templates/web/ui-auth-payments/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments/template/src/app/auth/callback/route.ts +0 -12
- package/dist/templates/web/ui-auth-payments/template/src/app/billing/page.tsx +0 -211
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +0 -142
- package/dist/templates/web/ui-auth-payments/template/src/app/error.tsx +0 -67
- package/dist/templates/web/ui-auth-payments/template/src/app/globals.css +0 -42
- package/dist/templates/web/ui-auth-payments/template/src/app/layout.tsx +0 -33
- package/dist/templates/web/ui-auth-payments/template/src/app/loading.tsx +0 -20
- package/dist/templates/web/ui-auth-payments/template/src/app/login/loading.tsx +0 -38
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +0 -109
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +0 -143
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/loading.tsx +0 -50
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +0 -128
- package/dist/templates/web/ui-auth-payments/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments/template/src/components/client/newsletter-signup.tsx +0 -68
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/app-providers.tsx +0 -32
- package/dist/templates/web/ui-auth-payments/template/src/components/providers/theme-provider.tsx +0 -94
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/footer.tsx +0 -36
- package/dist/templates/web/ui-auth-payments/template/src/components/shared/header.tsx +0 -62
- package/dist/templates/web/ui-auth-payments/template/src/components/ui/badge.tsx +0 -36
- package/dist/templates/web/ui-auth-payments/template/src/components/ui/theme-toggle.tsx +0 -34
- package/dist/templates/web/ui-auth-payments/template/src/lib/actions/index.ts +0 -340
- package/dist/templates/web/ui-auth-payments/template/src/lib/auth-server.ts +0 -177
- package/dist/templates/web/ui-auth-payments/template/src/lib/env.ts +0 -49
- package/dist/templates/web/ui-auth-payments/template/src/lib/utils.ts +0 -140
- package/dist/templates/web/ui-auth-payments/template/src/test/setup.ts +0 -79
- package/dist/templates/web/ui-auth-payments/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments/template/tsconfig.json +0 -33
- package/dist/templates/web/ui-auth-payments/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-audio/template/.env.example +0 -15
- package/dist/templates/web/ui-auth-payments-audio/template/README.md +0 -187
- package/dist/templates/web/ui-auth-payments-audio/template/next.config.js +0 -12
- package/dist/templates/web/ui-auth-payments-audio/template/package.json +0 -53
- package/dist/templates/web/ui-auth-payments-audio/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/auth/callback/route.ts +0 -12
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/billing/page.tsx +0 -211
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/checkout/page.tsx +0 -142
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/error.tsx +0 -67
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/globals.css +0 -42
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/layout.tsx +0 -35
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/loading.tsx +0 -20
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/login/page.tsx +0 -109
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +0 -181
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/signup/page.tsx +0 -128
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/app-providers.tsx +0 -32
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/providers/theme-provider.tsx +0 -94
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/footer.tsx +0 -36
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/shared/header.tsx +0 -62
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/ui/badge.tsx +0 -36
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/ui/theme-toggle.tsx +0 -34
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/env.ts +0 -49
- package/dist/templates/web/ui-auth-payments-audio/template/src/lib/utils.ts +0 -140
- package/dist/templates/web/ui-auth-payments-audio/template/src/test/setup.ts +0 -79
- package/dist/templates/web/ui-auth-payments-audio/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments-audio/template/tsconfig.json +0 -33
- package/dist/templates/web/ui-auth-payments-audio/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-auth-payments-video/template/.env.example +0 -15
- package/dist/templates/web/ui-auth-payments-video/template/README.md +0 -190
- package/dist/templates/web/ui-auth-payments-video/template/next.config.js +0 -12
- package/dist/templates/web/ui-auth-payments-video/template/package.json +0 -53
- package/dist/templates/web/ui-auth-payments-video/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-auth-payments-video/template/src/app/auth/callback/route.ts +0 -12
- package/dist/templates/web/ui-auth-payments-video/template/src/app/billing/page.tsx +0 -211
- package/dist/templates/web/ui-auth-payments-video/template/src/app/checkout/page.tsx +0 -142
- package/dist/templates/web/ui-auth-payments-video/template/src/app/error.tsx +0 -67
- package/dist/templates/web/ui-auth-payments-video/template/src/app/globals.css +0 -42
- package/dist/templates/web/ui-auth-payments-video/template/src/app/layout.tsx +0 -33
- package/dist/templates/web/ui-auth-payments-video/template/src/app/loading.tsx +0 -20
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +0 -109
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +0 -187
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +0 -128
- package/dist/templates/web/ui-auth-payments-video/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/app-providers.tsx +0 -32
- package/dist/templates/web/ui-auth-payments-video/template/src/components/providers/theme-provider.tsx +0 -94
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/footer.tsx +0 -36
- package/dist/templates/web/ui-auth-payments-video/template/src/components/shared/header.tsx +0 -62
- package/dist/templates/web/ui-auth-payments-video/template/src/components/ui/badge.tsx +0 -36
- package/dist/templates/web/ui-auth-payments-video/template/src/components/ui/theme-toggle.tsx +0 -34
- package/dist/templates/web/ui-auth-payments-video/template/src/lib/env.ts +0 -49
- package/dist/templates/web/ui-auth-payments-video/template/src/lib/utils.ts +0 -140
- package/dist/templates/web/ui-auth-payments-video/template/src/test/setup.ts +0 -79
- package/dist/templates/web/ui-auth-payments-video/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-auth-payments-video/template/tsconfig.json +0 -33
- package/dist/templates/web/ui-auth-payments-video/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-only/template/.env.example +0 -15
- package/dist/templates/web/ui-only/template/.eslintrc.js +0 -8
- package/dist/templates/web/ui-only/template/README.md +0 -68
- package/dist/templates/web/ui-only/template/next.config.js +0 -12
- package/dist/templates/web/ui-only/template/package.json +0 -49
- package/dist/templates/web/ui-only/template/postcss.config.js +0 -7
- package/dist/templates/web/ui-only/template/src/app/auth/callback/route.ts +0 -12
- package/dist/templates/web/ui-only/template/src/app/checkout/page.tsx +0 -25
- package/dist/templates/web/ui-only/template/src/app/error.tsx +0 -67
- package/dist/templates/web/ui-only/template/src/app/globals.css +0 -42
- package/dist/templates/web/ui-only/template/src/app/layout.tsx +0 -33
- package/dist/templates/web/ui-only/template/src/app/loading.tsx +0 -20
- package/dist/templates/web/ui-only/template/src/app/login/page.tsx +0 -63
- package/dist/templates/web/ui-only/template/src/app/page.tsx +0 -91
- package/dist/templates/web/ui-only/template/src/app/signup/page.tsx +0 -79
- package/dist/templates/web/ui-only/template/src/components/__tests__/example.test.tsx +0 -49
- package/dist/templates/web/ui-only/template/src/components/providers/app-providers.tsx +0 -26
- package/dist/templates/web/ui-only/template/src/components/providers/theme-provider.tsx +0 -94
- package/dist/templates/web/ui-only/template/src/components/shared/footer.tsx +0 -36
- package/dist/templates/web/ui-only/template/src/components/shared/header.tsx +0 -53
- package/dist/templates/web/ui-only/template/src/components/ui/badge.tsx +0 -36
- package/dist/templates/web/ui-only/template/src/components/ui/theme-toggle.tsx +0 -34
- package/dist/templates/web/ui-only/template/src/lib/env.ts +0 -49
- package/dist/templates/web/ui-only/template/src/lib/utils.ts +0 -140
- package/dist/templates/web/ui-only/template/src/test/setup.ts +0 -79
- package/dist/templates/web/ui-only/template/tailwind.config.js +0 -77
- package/dist/templates/web/ui-only/template/tsconfig.json +0 -33
- package/dist/templates/web/ui-only/template/vitest.config.ts +0 -17
- package/dist/templates/web/ui-only/template.backup/.env.example +0 -15
- package/dist/templates/web/ui-only/template.backup.20250817/.env.example +0 -15
- package/dist/templates/web/ui-package-test/template/package.json +0 -42
- package/dist/templates/web/ui-package-test/template/src/app/page.tsx +0 -106
- package/dist/templates/web/ui-package-test/template/tsconfig.json +0 -41
- /package/{dist/templates/web/ui-auth-payments → src/templates/web/ui-auth-payments-audio}/template/middleware.ts +0 -0
- /package/{dist/templates/web/ui-auth-payments → src/templates/web/ui-auth-payments-audio}/template/src/app/dashboard/layout.tsx +0 -0
- /package/{dist/templates/web/ui-auth-payments → src/templates/web/ui-auth-payments-audio}/template/src/app/dashboard/page.tsx +0 -0
- /package/{dist/templates/web/ui-auth-payments → src/templates/web/ui-auth-payments-audio}/template/src/components/client/auth-status.tsx +0 -0
- /package/{dist/templates/web/ui-auth-payments → src/templates/web/ui-auth-payments-audio}/template/src/lib/actions/auth.ts +0 -0
- /package/{dist/templates/web/base → src/templates/web/ui-auth-payments-audio}/template/src/lib/auth-server.ts +0 -0
|
@@ -1,109 +1,6 @@
|
|
|
1
|
-
'
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui';
|
|
5
|
-
import { useAuth } from '@digilogiclabs/saas-factory-auth';
|
|
6
|
-
import { useRouter } from 'next/navigation';
|
|
1
|
+
import { LoginForm } from '@/components/client/login-form'
|
|
7
2
|
|
|
8
3
|
export default function LoginPage() {
|
|
9
|
-
|
|
10
|
-
const [password, setPassword] = useState('');
|
|
11
|
-
const { signIn, signInWithOAuth, loading, error, user } = useAuth();
|
|
12
|
-
const router = useRouter();
|
|
13
|
-
|
|
14
|
-
// Redirect if already logged in
|
|
15
|
-
React.useEffect(() => {
|
|
16
|
-
if (user) {
|
|
17
|
-
router.push('/');
|
|
18
|
-
}
|
|
19
|
-
}, [user, router]);
|
|
20
|
-
|
|
21
|
-
const handleLogin = async (e: React.FormEvent) => {
|
|
22
|
-
e.preventDefault();
|
|
23
|
-
try {
|
|
24
|
-
await signIn(email, password);
|
|
25
|
-
router.push('/');
|
|
26
|
-
} catch (err) {
|
|
27
|
-
console.error('Login error:', err);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const handleGoogleLogin = async () => {
|
|
32
|
-
try {
|
|
33
|
-
await signInWithOAuth('google', window.location.origin);
|
|
34
|
-
} catch (err) {
|
|
35
|
-
console.error('Google login error:', err);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
if (loading) {
|
|
40
|
-
return (
|
|
41
|
-
<div className="flex items-center justify-center min-h-screen bg-gray-100">
|
|
42
|
-
<div>Loading...</div>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<div className="flex items-center justify-center min-h-screen bg-gray-100">
|
|
49
|
-
<Card className="w-full max-w-md p-8">
|
|
50
|
-
<h1 className="text-2xl font-bold text-center mb-6">Sign In</h1>
|
|
51
|
-
|
|
52
|
-
{error && (
|
|
53
|
-
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
54
|
-
{error.message}
|
|
55
|
-
</div>
|
|
56
|
-
)}
|
|
57
|
-
|
|
58
|
-
<form onSubmit={handleLogin} className="space-y-4">
|
|
59
|
-
<div>
|
|
60
|
-
<Label htmlFor="email">Email</Label>
|
|
61
|
-
<Input
|
|
62
|
-
id="email"
|
|
63
|
-
type="email"
|
|
64
|
-
value={email}
|
|
65
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
66
|
-
placeholder="Enter your email"
|
|
67
|
-
required
|
|
68
|
-
disabled={loading}
|
|
69
|
-
/>
|
|
70
|
-
</div>
|
|
71
|
-
<div>
|
|
72
|
-
<Label htmlFor="password">Password</Label>
|
|
73
|
-
<Input
|
|
74
|
-
id="password"
|
|
75
|
-
type="password"
|
|
76
|
-
value={password}
|
|
77
|
-
onChange={(e) => setPassword(e.target.value)}
|
|
78
|
-
placeholder="Enter your password"
|
|
79
|
-
required
|
|
80
|
-
disabled={loading}
|
|
81
|
-
/>
|
|
82
|
-
</div>
|
|
83
|
-
<Button type="submit" className="w-full" disabled={loading}>
|
|
84
|
-
{loading ? 'Signing In...' : 'Sign In'}
|
|
85
|
-
</Button>
|
|
86
|
-
<Button
|
|
87
|
-
type="button"
|
|
88
|
-
variant="outline"
|
|
89
|
-
className="w-full"
|
|
90
|
-
onClick={handleGoogleLogin}
|
|
91
|
-
disabled={loading}
|
|
92
|
-
>
|
|
93
|
-
Sign in with Google
|
|
94
|
-
</Button>
|
|
95
|
-
</form>
|
|
96
|
-
|
|
97
|
-
<div className="mt-4 text-center">
|
|
98
|
-
<p className="text-sm text-gray-600">
|
|
99
|
-
Don't have an account?{' '}
|
|
100
|
-
<a href="/signup" className="text-blue-600 hover:underline">
|
|
101
|
-
Sign up
|
|
102
|
-
</a>
|
|
103
|
-
</p>
|
|
104
|
-
</div>
|
|
105
|
-
</Card>
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
4
|
+
return <LoginForm />
|
|
108
5
|
}
|
|
109
6
|
|
|
@@ -1,128 +1,6 @@
|
|
|
1
|
-
'
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui';
|
|
5
|
-
import { useAuth } from '@digilogiclabs/saas-factory-auth';
|
|
6
|
-
import { useRouter } from 'next/navigation';
|
|
1
|
+
import { SignupForm } from '@/components/client/signup-form'
|
|
7
2
|
|
|
8
3
|
export default function SignupPage() {
|
|
9
|
-
|
|
10
|
-
const [password, setPassword] = useState('');
|
|
11
|
-
const [confirmPassword, setConfirmPassword] = useState('');
|
|
12
|
-
const { signUp, signInWithOAuth, loading, error, user } = useAuth();
|
|
13
|
-
const router = useRouter();
|
|
14
|
-
|
|
15
|
-
// Redirect if already logged in
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
if (user) {
|
|
18
|
-
router.push('/');
|
|
19
|
-
}
|
|
20
|
-
}, [user, router]);
|
|
21
|
-
|
|
22
|
-
const handleSignup = async (e: React.FormEvent) => {
|
|
23
|
-
e.preventDefault();
|
|
24
|
-
|
|
25
|
-
if (password !== confirmPassword) {
|
|
26
|
-
alert('Passwords do not match');
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
await signUp(email, password);
|
|
32
|
-
router.push('/');
|
|
33
|
-
} catch (err) {
|
|
34
|
-
console.error('Signup error:', err);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const handleGoogleSignup = async () => {
|
|
39
|
-
try {
|
|
40
|
-
await signInWithOAuth('google', window.location.origin);
|
|
41
|
-
} catch (err) {
|
|
42
|
-
console.error('Google signup error:', err);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
if (loading) {
|
|
47
|
-
return (
|
|
48
|
-
<div className="flex items-center justify-center min-h-screen bg-gray-100">
|
|
49
|
-
<div>Loading...</div>
|
|
50
|
-
</div>
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<div className="flex items-center justify-center min-h-screen bg-gray-100">
|
|
56
|
-
<Card className="w-full max-w-md p-8">
|
|
57
|
-
<h1 className="text-2xl font-bold text-center mb-6">Sign Up</h1>
|
|
58
|
-
|
|
59
|
-
{error && (
|
|
60
|
-
<div className="mb-4 p-3 bg-red-100 border border-red-400 text-red-700 rounded">
|
|
61
|
-
{error.message}
|
|
62
|
-
</div>
|
|
63
|
-
)}
|
|
64
|
-
|
|
65
|
-
<form onSubmit={handleSignup} className="space-y-4">
|
|
66
|
-
<div>
|
|
67
|
-
<Label htmlFor="email">Email</Label>
|
|
68
|
-
<Input
|
|
69
|
-
id="email"
|
|
70
|
-
type="email"
|
|
71
|
-
value={email}
|
|
72
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
73
|
-
placeholder="Enter your email"
|
|
74
|
-
required
|
|
75
|
-
disabled={loading}
|
|
76
|
-
/>
|
|
77
|
-
</div>
|
|
78
|
-
<div>
|
|
79
|
-
<Label htmlFor="password">Password</Label>
|
|
80
|
-
<Input
|
|
81
|
-
id="password"
|
|
82
|
-
type="password"
|
|
83
|
-
value={password}
|
|
84
|
-
onChange={(e) => setPassword(e.target.value)}
|
|
85
|
-
placeholder="Enter your password"
|
|
86
|
-
required
|
|
87
|
-
disabled={loading}
|
|
88
|
-
/>
|
|
89
|
-
</div>
|
|
90
|
-
<div>
|
|
91
|
-
<Label htmlFor="confirmPassword">Confirm Password</Label>
|
|
92
|
-
<Input
|
|
93
|
-
id="confirmPassword"
|
|
94
|
-
type="password"
|
|
95
|
-
value={confirmPassword}
|
|
96
|
-
onChange={(e) => setConfirmPassword(e.target.value)}
|
|
97
|
-
placeholder="Confirm your password"
|
|
98
|
-
required
|
|
99
|
-
disabled={loading}
|
|
100
|
-
/>
|
|
101
|
-
</div>
|
|
102
|
-
<Button type="submit" className="w-full" disabled={loading}>
|
|
103
|
-
{loading ? 'Signing Up...' : 'Sign Up'}
|
|
104
|
-
</Button>
|
|
105
|
-
<Button
|
|
106
|
-
type="button"
|
|
107
|
-
variant="outline"
|
|
108
|
-
className="w-full"
|
|
109
|
-
onClick={handleGoogleSignup}
|
|
110
|
-
disabled={loading}
|
|
111
|
-
>
|
|
112
|
-
Sign up with Google
|
|
113
|
-
</Button>
|
|
114
|
-
</form>
|
|
115
|
-
|
|
116
|
-
<div className="mt-4 text-center">
|
|
117
|
-
<p className="text-sm text-gray-600">
|
|
118
|
-
Already have an account?{' '}
|
|
119
|
-
<a href="/login" className="text-blue-600 hover:underline">
|
|
120
|
-
Sign in
|
|
121
|
-
</a>
|
|
122
|
-
</p>
|
|
123
|
-
</div>
|
|
124
|
-
</Card>
|
|
125
|
-
</div>
|
|
126
|
-
);
|
|
4
|
+
return <SignupForm />
|
|
127
5
|
}
|
|
128
6
|
|
|
@@ -10,7 +10,7 @@ export function LoginForm() {
|
|
|
10
10
|
const [email, setEmail] = useState('')
|
|
11
11
|
const [password, setPassword] = useState('')
|
|
12
12
|
const { signIn, signInWithOAuth, loading, error, user } = useAuth()
|
|
13
|
-
const [actionState, formAction] = useActionState(signInAction,
|
|
13
|
+
const [actionState, formAction] = useActionState(signInAction, { success: false })
|
|
14
14
|
const router = useRouter()
|
|
15
15
|
|
|
16
16
|
// Redirect if already logged in
|
|
@@ -12,7 +12,7 @@ export function SignupForm() {
|
|
|
12
12
|
const [password, setPassword] = useState('')
|
|
13
13
|
const [confirmPassword, setConfirmPassword] = useState('')
|
|
14
14
|
const { signUp, signInWithOAuth, loading, error, user } = useAuth()
|
|
15
|
-
const [actionState, formAction] = useActionState(signUpAction,
|
|
15
|
+
const [actionState, formAction] = useActionState(signUpAction, { success: false })
|
|
16
16
|
const router = useRouter()
|
|
17
17
|
|
|
18
18
|
// Redirect if already logged in
|
|
@@ -31,7 +31,7 @@ export function SignupForm() {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
try {
|
|
34
|
-
await signUp(email, password
|
|
34
|
+
await signUp(email, password)
|
|
35
35
|
router.push('/')
|
|
36
36
|
} catch (err) {
|
|
37
37
|
console.error('Sign up error:', err)
|
|
@@ -57,7 +57,7 @@ export function SignupForm() {
|
|
|
57
57
|
const nameValue = formData.get('name') as string
|
|
58
58
|
|
|
59
59
|
try {
|
|
60
|
-
await signUp(emailValue, passwordValue
|
|
60
|
+
await signUp(emailValue, passwordValue)
|
|
61
61
|
router.push('/')
|
|
62
62
|
} catch (err) {
|
|
63
63
|
console.error('Sign up error:', err)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Re-export all server actions for easier imports
|
|
2
|
+
export {
|
|
3
|
+
signInAction,
|
|
4
|
+
signUpAction,
|
|
5
|
+
signOutAction,
|
|
6
|
+
handleOAuthCallback,
|
|
7
|
+
requestPasswordReset,
|
|
8
|
+
updateProfileAction,
|
|
9
|
+
} from './auth'
|
|
10
|
+
|
|
11
|
+
// Add other action exports here as needed
|
|
12
|
+
// export * from './posts'
|
|
13
|
+
// export * from './profile'
|
|
14
|
+
// export * from './settings'
|