@digilogiclabs/create-saas-app 2.8.1 → 2.9.0
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/generators/template-generator.js +8 -8
- package/dist/generators/template-generator.js.map +1 -1
- package/dist/templates/shared/quality/web/src/__tests__/accessibility.test.tsx +3 -3
- package/dist/templates/web/ai-platform/template/src/app/page.tsx +207 -207
- package/dist/templates/web/base/template/src/app/dashboard/page.tsx +6 -43
- package/dist/templates/web/base/template/src/app/page.tsx +2 -2
- package/dist/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +800 -800
- package/dist/templates/web/ui-auth/template/src/app/login/page.tsx +109 -109
- package/dist/templates/web/ui-auth/template/src/app/page.tsx +3 -3
- package/dist/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -128
- package/dist/templates/web/ui-auth-ai/template/src/app/globals.css +35 -40
- package/dist/templates/web/ui-auth-ai/template/src/app/layout.tsx +1 -0
- package/dist/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +3 -3
- package/dist/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +10 -49
- package/dist/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +800 -800
- package/dist/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -109
- package/dist/templates/web/ui-auth-payments/template/src/app/page.tsx +350 -350
- package/dist/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +506 -506
- package/dist/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -128
- package/dist/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +143 -143
- package/dist/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +184 -184
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +143 -233
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +10 -50
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +800 -800
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +325 -364
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +389 -532
- package/dist/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +644 -644
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +119 -163
- package/dist/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +158 -201
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +10 -51
- package/dist/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +402 -403
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +143 -143
- package/dist/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +184 -184
- package/dist/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +1 -1
- package/dist/templates/web/ui-auth-payments-video/template/src/app/page.tsx +3 -7
- package/dist/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +1 -1
- package/package.json +1 -1
- package/src/templates/shared/quality/web/src/__tests__/accessibility.test.tsx +3 -3
- package/src/templates/web/ai-platform/template/src/app/page.tsx +207 -207
- package/src/templates/web/base/template/src/app/dashboard/page.tsx +6 -43
- package/src/templates/web/base/template/src/app/page.tsx +2 -2
- package/src/templates/web/ui-auth/template/src/app/dev-setup/page.tsx +800 -800
- package/src/templates/web/ui-auth/template/src/app/login/page.tsx +109 -109
- package/src/templates/web/ui-auth/template/src/app/page.tsx +3 -3
- package/src/templates/web/ui-auth/template/src/app/signup/page.tsx +128 -128
- package/src/templates/web/ui-auth-ai/template/src/app/globals.css +35 -40
- package/src/templates/web/ui-auth-ai/template/src/app/layout.tsx +1 -0
- package/src/templates/web/ui-auth-payments/template/src/app/checkout/page.tsx +3 -3
- package/src/templates/web/ui-auth-payments/template/src/app/dashboard/page.tsx +10 -49
- package/src/templates/web/ui-auth-payments/template/src/app/dev-setup/page.tsx +800 -800
- package/src/templates/web/ui-auth-payments/template/src/app/login/page.tsx +109 -109
- package/src/templates/web/ui-auth-payments/template/src/app/page.tsx +350 -350
- package/src/templates/web/ui-auth-payments/template/src/app/setup/page.tsx +506 -506
- package/src/templates/web/ui-auth-payments/template/src/app/signup/page.tsx +128 -128
- package/src/templates/web/ui-auth-payments/template/src/components/client/login-form.tsx +143 -143
- package/src/templates/web/ui-auth-payments/template/src/components/client/signup-form.tsx +184 -184
- package/src/templates/web/ui-auth-payments-ai/template/src/app/billing/page.tsx +143 -233
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dashboard/page.tsx +10 -50
- package/src/templates/web/ui-auth-payments-ai/template/src/app/dev-setup/page.tsx +800 -800
- package/src/templates/web/ui-auth-payments-ai/template/src/app/onboarding/page.tsx +325 -364
- package/src/templates/web/ui-auth-payments-ai/template/src/app/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-ai/template/src/app/settings/page.tsx +389 -532
- package/src/templates/web/ui-auth-payments-ai/template/src/app/setup/page.tsx +644 -644
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/login-form.tsx +119 -163
- package/src/templates/web/ui-auth-payments-ai/template/src/components/client/signup-form.tsx +158 -201
- package/src/templates/web/ui-auth-payments-audio/template/src/app/dashboard/page.tsx +10 -51
- package/src/templates/web/ui-auth-payments-audio/template/src/app/page.tsx +402 -403
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/login-form.tsx +143 -143
- package/src/templates/web/ui-auth-payments-audio/template/src/components/client/signup-form.tsx +184 -184
- package/src/templates/web/ui-auth-payments-video/template/src/app/login/page.tsx +1 -1
- package/src/templates/web/ui-auth-payments-video/template/src/app/page.tsx +3 -7
- package/src/templates/web/ui-auth-payments-video/template/src/app/signup/page.tsx +1 -1
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui';
|
|
5
|
-
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
6
|
-
import { useRouter } from 'next/navigation';
|
|
7
|
-
|
|
8
|
-
export default function LoginPage() {
|
|
9
|
-
const [email, setEmail] = useState('');
|
|
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'
|
|
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
|
-
);
|
|
108
|
-
}
|
|
109
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { Button, Card, Input, Label } from '@digilogiclabs/saas-factory-ui';
|
|
5
|
+
import { useAuth } from '@digilogiclabs/app-sdk';
|
|
6
|
+
import { useRouter } from 'next/navigation';
|
|
7
|
+
|
|
8
|
+
export default function LoginPage() {
|
|
9
|
+
const [email, setEmail] = useState('');
|
|
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');
|
|
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
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|