@drawnagency/primitives 0.1.5 → 0.1.6
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/package.json
CHANGED
|
@@ -12,12 +12,13 @@ interface Props {
|
|
|
12
12
|
};
|
|
13
13
|
oauthProviders?: ("google" | "github")[];
|
|
14
14
|
next?: string | null;
|
|
15
|
+
serverError?: string | null;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
export function EditorLoginForm({ capabilities, oauthProviders = [], next }: Props) {
|
|
18
|
+
export function EditorLoginForm({ capabilities, oauthProviders = [], next, serverError }: Props) {
|
|
18
19
|
const [email, setEmail] = useState("");
|
|
19
20
|
const [password, setPassword] = useState("");
|
|
20
|
-
const [error, setError] = useState<string | null>(null);
|
|
21
|
+
const [error, setError] = useState<string | null>(serverError ?? null);
|
|
21
22
|
const [loading, setLoading] = useState(false);
|
|
22
23
|
|
|
23
24
|
async function handlePasswordSubmit(e: FormEvent) {
|
|
@@ -52,10 +53,8 @@ export function EditorLoginForm({ capabilities, oauthProviders = [], next }: Pro
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// Implementation depends on Supabase adapter (Task 11)
|
|
58
|
-
// For now, this is a placeholder that will be wired up later
|
|
56
|
+
function handleOAuth(provider: "google" | "github") {
|
|
57
|
+
window.location.href = `/api/auth/oauth?provider=${provider}`;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
60
|
return (
|