@githat/nextjs 0.4.1 → 0.4.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/README.md +580 -45
- package/dist/githat.css +41 -0
- package/dist/index.js +63 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +129 -70
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.js.map +1 -1
- package/dist/middleware.mjs.map +1 -1
- package/dist/proxy.js.map +1 -1
- package/dist/proxy.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -86,14 +86,21 @@ function createClient(apiUrl, appKey, options = {}) {
|
|
|
86
86
|
});
|
|
87
87
|
} catch (networkError) {
|
|
88
88
|
if (networkError instanceof TypeError) {
|
|
89
|
-
const isMissingKey = !appKey || !appKey.startsWith("pk_live_");
|
|
89
|
+
const isMissingKey = !appKey || !appKey.startsWith("pk_live_") && !appKey.startsWith("pk_test_");
|
|
90
90
|
const isLocalhost = typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1");
|
|
91
91
|
if (isMissingKey && !isLocalhost) {
|
|
92
92
|
throw new Error(
|
|
93
|
-
"Missing
|
|
93
|
+
"GitHat: Missing or invalid publishable key. Add NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY to your environment variables. Get your key at https://githat.io/dashboard/apps"
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
if (isLocalhost) {
|
|
97
|
+
throw new Error(
|
|
98
|
+
"GitHat: Cannot reach api.githat.io. Check your internet connection."
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
throw new Error(
|
|
102
|
+
"GitHat: API request failed. Verify your publishable key and app domain at https://githat.io/dashboard/apps"
|
|
103
|
+
);
|
|
97
104
|
}
|
|
98
105
|
throw networkError;
|
|
99
106
|
}
|
|
@@ -129,12 +136,61 @@ function createClient(apiUrl, appKey, options = {}) {
|
|
|
129
136
|
}
|
|
130
137
|
|
|
131
138
|
// src/provider.tsx
|
|
132
|
-
import { jsx } from "react/jsx-runtime";
|
|
139
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
133
140
|
var GitHatContext = createContext(null);
|
|
141
|
+
function isDevMode(key) {
|
|
142
|
+
return !key || !key.startsWith("pk_live_") && !key.startsWith("pk_test_");
|
|
143
|
+
}
|
|
144
|
+
function DevModeBanner() {
|
|
145
|
+
const [dismissed, setDismissed] = useState(() => {
|
|
146
|
+
if (typeof window === "undefined") return true;
|
|
147
|
+
return localStorage.getItem("githat_dev_banner_dismissed") === "1";
|
|
148
|
+
});
|
|
149
|
+
if (dismissed || typeof window === "undefined") return null;
|
|
150
|
+
const hostname = window.location.hostname;
|
|
151
|
+
if (hostname !== "localhost" && hostname !== "127.0.0.1") return null;
|
|
152
|
+
return /* @__PURE__ */ jsxs("div", { className: "githat-dev-banner", role: "status", children: [
|
|
153
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
154
|
+
/* @__PURE__ */ jsx("strong", { children: "GitHat Dev Mode" }),
|
|
155
|
+
" \u2014 No publishable key. Auth works on localhost.",
|
|
156
|
+
" ",
|
|
157
|
+
/* @__PURE__ */ jsx("a", { href: "https://githat.io/dashboard/apps", target: "_blank", rel: "noopener noreferrer", children: "Get your key" })
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsx(
|
|
160
|
+
"button",
|
|
161
|
+
{
|
|
162
|
+
onClick: () => {
|
|
163
|
+
setDismissed(true);
|
|
164
|
+
localStorage.setItem("githat_dev_banner_dismissed", "1");
|
|
165
|
+
},
|
|
166
|
+
"aria-label": "Dismiss",
|
|
167
|
+
children: "\xD7"
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
] });
|
|
171
|
+
}
|
|
134
172
|
function GitHatProvider({ config: rawConfig, children }) {
|
|
135
173
|
const config = useMemo(() => resolveConfig(rawConfig), [rawConfig]);
|
|
136
174
|
const useCookies = config.tokenStorage === "cookie";
|
|
175
|
+
const devMode = isDevMode(config.publishableKey);
|
|
137
176
|
const clientRef = useRef(createClient(config.apiUrl, config.publishableKey, { useCookies }));
|
|
177
|
+
useEffect(() => {
|
|
178
|
+
if (!devMode || typeof window === "undefined") return;
|
|
179
|
+
const hostname = window.location.hostname;
|
|
180
|
+
if (hostname === "localhost" || hostname === "127.0.0.1") {
|
|
181
|
+
console.warn(
|
|
182
|
+
"%c GitHat Dev Mode %c No publishable key configured. Auth works on localhost but will fail in production. Get your key at https://githat.io/dashboard/apps",
|
|
183
|
+
"background: #f59e0b; color: #000; font-weight: bold; padding: 2px 6px; border-radius: 3px;",
|
|
184
|
+
"color: #f59e0b;"
|
|
185
|
+
);
|
|
186
|
+
} else {
|
|
187
|
+
console.error(
|
|
188
|
+
"%c GitHat %c Missing publishable key. Auth requests will fail. Add NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY to your environment. Get your key at https://githat.io/dashboard/apps",
|
|
189
|
+
"background: #ef4444; color: #fff; font-weight: bold; padding: 2px 6px; border-radius: 3px;",
|
|
190
|
+
"color: #ef4444;"
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
}, []);
|
|
138
194
|
const [user, setUser] = useState(null);
|
|
139
195
|
const [org, setOrg] = useState(null);
|
|
140
196
|
const [isSignedIn, setIsSignedIn] = useState(false);
|
|
@@ -282,7 +338,10 @@ function GitHatProvider({ config: rawConfig, children }) {
|
|
|
282
338
|
signOut,
|
|
283
339
|
switchOrg
|
|
284
340
|
}), [user, org, isSignedIn, isLoading, authError, config, signIn, signUp, signOut, switchOrg]);
|
|
285
|
-
return /* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ jsxs(GitHatContext.Provider, { value, children: [
|
|
342
|
+
devMode && /* @__PURE__ */ jsx(DevModeBanner, {}),
|
|
343
|
+
children
|
|
344
|
+
] });
|
|
286
345
|
}
|
|
287
346
|
|
|
288
347
|
// src/hooks.ts
|
|
@@ -490,7 +549,7 @@ function useData() {
|
|
|
490
549
|
|
|
491
550
|
// src/components/SignInForm.tsx
|
|
492
551
|
import { useState as useState2 } from "react";
|
|
493
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
552
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
494
553
|
function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }) {
|
|
495
554
|
const { signIn, config } = useAuth();
|
|
496
555
|
const [email, setEmail] = useState2("");
|
|
@@ -520,14 +579,14 @@ function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }) {
|
|
|
520
579
|
setLoading(false);
|
|
521
580
|
}
|
|
522
581
|
};
|
|
523
|
-
return /* @__PURE__ */
|
|
524
|
-
/* @__PURE__ */
|
|
582
|
+
return /* @__PURE__ */ jsxs2("div", { className: "githat-form-container", children: [
|
|
583
|
+
/* @__PURE__ */ jsxs2("div", { className: "githat-form-header", children: [
|
|
525
584
|
/* @__PURE__ */ jsx2("h2", { className: "githat-form-title", children: "Sign in" }),
|
|
526
585
|
/* @__PURE__ */ jsx2("p", { className: "githat-form-subtitle", children: "Welcome back to GitHat" })
|
|
527
586
|
] }),
|
|
528
587
|
error && /* @__PURE__ */ jsx2("div", { className: "githat-alert githat-alert-error", role: "alert", "aria-live": "polite", children: error }),
|
|
529
|
-
/* @__PURE__ */
|
|
530
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ jsxs2("form", { onSubmit: handleSubmit, className: "githat-form", "aria-label": "Sign in form", children: [
|
|
589
|
+
/* @__PURE__ */ jsxs2("div", { className: "githat-field", children: [
|
|
531
590
|
/* @__PURE__ */ jsx2("label", { className: "githat-label", htmlFor: "githat-signin-email", children: "Email" }),
|
|
532
591
|
/* @__PURE__ */ jsx2(
|
|
533
592
|
"input",
|
|
@@ -543,7 +602,7 @@ function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }) {
|
|
|
543
602
|
}
|
|
544
603
|
)
|
|
545
604
|
] }),
|
|
546
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ jsxs2("div", { className: "githat-field", children: [
|
|
547
606
|
/* @__PURE__ */ jsx2("label", { className: "githat-label", htmlFor: "githat-signin-password", children: "Password" }),
|
|
548
607
|
/* @__PURE__ */ jsx2(
|
|
549
608
|
"input",
|
|
@@ -570,11 +629,11 @@ function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }) {
|
|
|
570
629
|
}
|
|
571
630
|
)
|
|
572
631
|
] }),
|
|
573
|
-
signUpUrl && /* @__PURE__ */
|
|
632
|
+
signUpUrl && /* @__PURE__ */ jsxs2("p", { className: "githat-form-footer", children: [
|
|
574
633
|
"Don't have an account? ",
|
|
575
634
|
/* @__PURE__ */ jsx2("a", { href: signUpUrl, className: "githat-link", children: "Sign up" })
|
|
576
635
|
] }),
|
|
577
|
-
/* @__PURE__ */
|
|
636
|
+
/* @__PURE__ */ jsxs2("p", { className: "githat-powered-by", children: [
|
|
578
637
|
"Secured by ",
|
|
579
638
|
/* @__PURE__ */ jsx2("strong", { children: "GitHat" })
|
|
580
639
|
] })
|
|
@@ -583,7 +642,7 @@ function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }) {
|
|
|
583
642
|
|
|
584
643
|
// src/components/SignUpForm.tsx
|
|
585
644
|
import { useState as useState3 } from "react";
|
|
586
|
-
import { jsx as jsx3, jsxs as
|
|
645
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
587
646
|
function SignUpForm({ onSuccess, signInUrl }) {
|
|
588
647
|
const { signUp, config } = useAuth();
|
|
589
648
|
const [name, setName] = useState3("");
|
|
@@ -618,14 +677,14 @@ function SignUpForm({ onSuccess, signInUrl }) {
|
|
|
618
677
|
setLoading(false);
|
|
619
678
|
}
|
|
620
679
|
};
|
|
621
|
-
return /* @__PURE__ */
|
|
622
|
-
/* @__PURE__ */
|
|
680
|
+
return /* @__PURE__ */ jsxs3("div", { className: "githat-form-container", children: [
|
|
681
|
+
/* @__PURE__ */ jsxs3("div", { className: "githat-form-header", children: [
|
|
623
682
|
/* @__PURE__ */ jsx3("h2", { className: "githat-form-title", children: "Create an account" }),
|
|
624
683
|
/* @__PURE__ */ jsx3("p", { className: "githat-form-subtitle", children: "Get started with GitHat" })
|
|
625
684
|
] }),
|
|
626
685
|
error && /* @__PURE__ */ jsx3("div", { className: "githat-alert githat-alert-error", role: "alert", "aria-live": "polite", children: error }),
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ jsxs3("form", { onSubmit: handleSubmit, className: "githat-form", "aria-label": "Sign up form", children: [
|
|
687
|
+
/* @__PURE__ */ jsxs3("div", { className: "githat-field", children: [
|
|
629
688
|
/* @__PURE__ */ jsx3("label", { className: "githat-label", htmlFor: "githat-signup-name", children: "Full name" }),
|
|
630
689
|
/* @__PURE__ */ jsx3(
|
|
631
690
|
"input",
|
|
@@ -641,7 +700,7 @@ function SignUpForm({ onSuccess, signInUrl }) {
|
|
|
641
700
|
}
|
|
642
701
|
)
|
|
643
702
|
] }),
|
|
644
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ jsxs3("div", { className: "githat-field", children: [
|
|
645
704
|
/* @__PURE__ */ jsx3("label", { className: "githat-label", htmlFor: "githat-signup-email", children: "Email" }),
|
|
646
705
|
/* @__PURE__ */ jsx3(
|
|
647
706
|
"input",
|
|
@@ -657,7 +716,7 @@ function SignUpForm({ onSuccess, signInUrl }) {
|
|
|
657
716
|
}
|
|
658
717
|
)
|
|
659
718
|
] }),
|
|
660
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ jsxs3("div", { className: "githat-field", children: [
|
|
661
720
|
/* @__PURE__ */ jsx3("label", { className: "githat-label", htmlFor: "githat-signup-password", children: "Password" }),
|
|
662
721
|
/* @__PURE__ */ jsx3(
|
|
663
722
|
"input",
|
|
@@ -684,11 +743,11 @@ function SignUpForm({ onSuccess, signInUrl }) {
|
|
|
684
743
|
}
|
|
685
744
|
)
|
|
686
745
|
] }),
|
|
687
|
-
signInUrl && /* @__PURE__ */
|
|
746
|
+
signInUrl && /* @__PURE__ */ jsxs3("p", { className: "githat-form-footer", children: [
|
|
688
747
|
"Already have an account? ",
|
|
689
748
|
/* @__PURE__ */ jsx3("a", { href: signInUrl, className: "githat-link", children: "Sign in" })
|
|
690
749
|
] }),
|
|
691
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ jsxs3("p", { className: "githat-powered-by", children: [
|
|
692
751
|
"Secured by ",
|
|
693
752
|
/* @__PURE__ */ jsx3("strong", { children: "GitHat" })
|
|
694
753
|
] })
|
|
@@ -715,7 +774,7 @@ function SignUpButton({ className, children, href }) {
|
|
|
715
774
|
|
|
716
775
|
// src/components/UserButton.tsx
|
|
717
776
|
import { useState as useState4, useRef as useRef2, useEffect as useEffect2 } from "react";
|
|
718
|
-
import { jsx as jsx6, jsxs as
|
|
777
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
719
778
|
function UserButton() {
|
|
720
779
|
const { user, org, isSignedIn, signOut } = useAuth();
|
|
721
780
|
const [open, setOpen] = useState4(false);
|
|
@@ -729,10 +788,10 @@ function UserButton() {
|
|
|
729
788
|
}, []);
|
|
730
789
|
if (!isSignedIn || !user) return null;
|
|
731
790
|
const initials = user.name ? user.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) : user.email[0].toUpperCase();
|
|
732
|
-
return /* @__PURE__ */
|
|
791
|
+
return /* @__PURE__ */ jsxs4("div", { className: "githat-user-button", ref, children: [
|
|
733
792
|
/* @__PURE__ */ jsx6("button", { className: "githat-avatar-trigger", onClick: () => setOpen(!open), "aria-label": "User menu", "aria-expanded": open, "aria-haspopup": "true", children: user.avatarUrl ? /* @__PURE__ */ jsx6("img", { src: user.avatarUrl, alt: user.name || "User avatar", className: "githat-avatar-img" }) : /* @__PURE__ */ jsx6("span", { className: "githat-avatar-initials", children: initials }) }),
|
|
734
|
-
open && /* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
793
|
+
open && /* @__PURE__ */ jsxs4("div", { className: "githat-dropdown", role: "menu", children: [
|
|
794
|
+
/* @__PURE__ */ jsxs4("div", { className: "githat-dropdown-header", children: [
|
|
736
795
|
/* @__PURE__ */ jsx6("p", { className: "githat-dropdown-name", children: user.name }),
|
|
737
796
|
/* @__PURE__ */ jsx6("p", { className: "githat-dropdown-email", children: user.email }),
|
|
738
797
|
org && /* @__PURE__ */ jsx6("p", { className: "githat-dropdown-org", children: org.name })
|
|
@@ -748,7 +807,7 @@ function UserButton() {
|
|
|
748
807
|
|
|
749
808
|
// src/components/OrgSwitcher.tsx
|
|
750
809
|
import { useState as useState5, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
751
|
-
import { jsx as jsx7, jsxs as
|
|
810
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
752
811
|
function OrgSwitcher() {
|
|
753
812
|
const { org, isSignedIn, switchOrg } = useAuth();
|
|
754
813
|
const githat = useGitHat();
|
|
@@ -771,12 +830,12 @@ function OrgSwitcher() {
|
|
|
771
830
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
772
831
|
}, []);
|
|
773
832
|
if (!isSignedIn || !org || orgs.length < 2 && !orgsLoading) return null;
|
|
774
|
-
return /* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ jsxs5("div", { className: "githat-org-switcher", ref, children: [
|
|
834
|
+
/* @__PURE__ */ jsxs5("button", { className: "githat-org-trigger", onClick: () => setOpen(!open), "aria-label": "Switch organization", "aria-expanded": open, "aria-haspopup": "true", children: [
|
|
776
835
|
/* @__PURE__ */ jsx7("span", { className: "githat-org-name", children: org.name }),
|
|
777
836
|
/* @__PURE__ */ jsx7("span", { className: "githat-chevron", children: open ? "\u25B2" : "\u25BC" })
|
|
778
837
|
] }),
|
|
779
|
-
open && /* @__PURE__ */ jsx7("div", { className: "githat-dropdown", role: "menu", children: orgsLoading ? /* @__PURE__ */ jsx7("div", { className: "githat-dropdown-item", "aria-busy": "true", children: "Loading..." }) : orgs.map((o) => /* @__PURE__ */
|
|
838
|
+
open && /* @__PURE__ */ jsx7("div", { className: "githat-dropdown", role: "menu", children: orgsLoading ? /* @__PURE__ */ jsx7("div", { className: "githat-dropdown-item", "aria-busy": "true", children: "Loading..." }) : orgs.map((o) => /* @__PURE__ */ jsxs5(
|
|
780
839
|
"button",
|
|
781
840
|
{
|
|
782
841
|
className: `githat-dropdown-item ${o.id === org.id ? "githat-dropdown-item-active" : ""}`,
|
|
@@ -798,7 +857,7 @@ function OrgSwitcher() {
|
|
|
798
857
|
|
|
799
858
|
// src/components/VerifiedBadge.tsx
|
|
800
859
|
import { useState as useState6, useEffect as useEffect4, useRef as useRef4 } from "react";
|
|
801
|
-
import { jsxs as
|
|
860
|
+
import { jsxs as jsxs6 } from "react/jsx-runtime";
|
|
802
861
|
var CACHE_TTL = 5 * 60 * 1e3;
|
|
803
862
|
var cache = /* @__PURE__ */ new Map();
|
|
804
863
|
function VerifiedBadge({ type, identifier, label }) {
|
|
@@ -827,7 +886,7 @@ function VerifiedBadge({ type, identifier, label }) {
|
|
|
827
886
|
};
|
|
828
887
|
}, [type, identifier]);
|
|
829
888
|
if (verified === null) return null;
|
|
830
|
-
return /* @__PURE__ */
|
|
889
|
+
return /* @__PURE__ */ jsxs6("span", { className: `githat-badge ${verified ? "githat-badge-verified" : "githat-badge-unverified"}`, children: [
|
|
831
890
|
verified ? "\u2713" : "\u2717",
|
|
832
891
|
" ",
|
|
833
892
|
label || (verified ? "Verified" : "Unverified")
|
|
@@ -852,7 +911,7 @@ function ProtectedRoute({ children, fallback }) {
|
|
|
852
911
|
|
|
853
912
|
// src/components/ForgotPasswordForm.tsx
|
|
854
913
|
import { useState as useState7 } from "react";
|
|
855
|
-
import { jsx as jsx9, jsxs as
|
|
914
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
856
915
|
function ForgotPasswordForm({
|
|
857
916
|
onSuccess,
|
|
858
917
|
onError,
|
|
@@ -885,29 +944,29 @@ function ForgotPasswordForm({
|
|
|
885
944
|
}
|
|
886
945
|
};
|
|
887
946
|
if (sent) {
|
|
888
|
-
return /* @__PURE__ */
|
|
889
|
-
/* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ jsxs7("div", { className: "githat-form-container", children: [
|
|
948
|
+
/* @__PURE__ */ jsxs7("div", { className: "githat-form-header", children: [
|
|
890
949
|
/* @__PURE__ */ jsx9("h2", { className: "githat-form-title", children: "Check your email" }),
|
|
891
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ jsxs7("p", { className: "githat-form-subtitle", children: [
|
|
892
951
|
"We sent a password reset link to ",
|
|
893
952
|
/* @__PURE__ */ jsx9("strong", { children: email })
|
|
894
953
|
] })
|
|
895
954
|
] }),
|
|
896
955
|
/* @__PURE__ */ jsx9("a", { href: signInUrl, className: "githat-link", children: "Back to sign in" }),
|
|
897
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ jsxs7("p", { className: "githat-powered-by", children: [
|
|
898
957
|
"Secured by ",
|
|
899
958
|
/* @__PURE__ */ jsx9("strong", { children: "GitHat" })
|
|
900
959
|
] })
|
|
901
960
|
] });
|
|
902
961
|
}
|
|
903
|
-
return /* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ jsxs7("div", { className: "githat-form-container", children: [
|
|
963
|
+
/* @__PURE__ */ jsxs7("div", { className: "githat-form-header", children: [
|
|
905
964
|
/* @__PURE__ */ jsx9("h2", { className: "githat-form-title", children: "Forgot password" }),
|
|
906
965
|
/* @__PURE__ */ jsx9("p", { className: "githat-form-subtitle", children: "Enter your email and we'll send you a reset link" })
|
|
907
966
|
] }),
|
|
908
967
|
error && /* @__PURE__ */ jsx9("div", { className: "githat-alert githat-alert-error", role: "alert", "aria-live": "polite", children: error }),
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ jsxs7("form", { onSubmit: handleSubmit, className: "githat-form", "aria-label": "Forgot password form", children: [
|
|
969
|
+
/* @__PURE__ */ jsxs7("div", { className: "githat-field", children: [
|
|
911
970
|
/* @__PURE__ */ jsx9("label", { className: "githat-label", htmlFor: "githat-forgot-email", children: "Email" }),
|
|
912
971
|
/* @__PURE__ */ jsx9(
|
|
913
972
|
"input",
|
|
@@ -934,11 +993,11 @@ function ForgotPasswordForm({
|
|
|
934
993
|
}
|
|
935
994
|
)
|
|
936
995
|
] }),
|
|
937
|
-
/* @__PURE__ */
|
|
996
|
+
/* @__PURE__ */ jsxs7("p", { className: "githat-form-footer", children: [
|
|
938
997
|
"Remember your password? ",
|
|
939
998
|
/* @__PURE__ */ jsx9("a", { href: signInUrl, className: "githat-link", children: "Sign in" })
|
|
940
999
|
] }),
|
|
941
|
-
/* @__PURE__ */
|
|
1000
|
+
/* @__PURE__ */ jsxs7("p", { className: "githat-powered-by", children: [
|
|
942
1001
|
"Secured by ",
|
|
943
1002
|
/* @__PURE__ */ jsx9("strong", { children: "GitHat" })
|
|
944
1003
|
] })
|
|
@@ -947,7 +1006,7 @@ function ForgotPasswordForm({
|
|
|
947
1006
|
|
|
948
1007
|
// src/components/ResetPasswordForm.tsx
|
|
949
1008
|
import { useState as useState8 } from "react";
|
|
950
|
-
import { jsx as jsx10, jsxs as
|
|
1009
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
951
1010
|
function ResetPasswordForm({
|
|
952
1011
|
token,
|
|
953
1012
|
onSuccess,
|
|
@@ -986,26 +1045,26 @@ function ResetPasswordForm({
|
|
|
986
1045
|
}
|
|
987
1046
|
};
|
|
988
1047
|
if (success) {
|
|
989
|
-
return /* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */
|
|
1048
|
+
return /* @__PURE__ */ jsxs8("div", { className: "githat-form-container", children: [
|
|
1049
|
+
/* @__PURE__ */ jsxs8("div", { className: "githat-form-header", children: [
|
|
991
1050
|
/* @__PURE__ */ jsx10("h2", { className: "githat-form-title", children: "Password reset!" }),
|
|
992
1051
|
/* @__PURE__ */ jsx10("p", { className: "githat-form-subtitle", children: "Your password has been successfully reset." })
|
|
993
1052
|
] }),
|
|
994
1053
|
/* @__PURE__ */ jsx10("a", { href: signInUrl, className: "githat-button githat-button-primary", style: { display: "block", textAlign: "center", textDecoration: "none" }, children: "Sign in" }),
|
|
995
|
-
/* @__PURE__ */
|
|
1054
|
+
/* @__PURE__ */ jsxs8("p", { className: "githat-powered-by", children: [
|
|
996
1055
|
"Secured by ",
|
|
997
1056
|
/* @__PURE__ */ jsx10("strong", { children: "GitHat" })
|
|
998
1057
|
] })
|
|
999
1058
|
] });
|
|
1000
1059
|
}
|
|
1001
|
-
return /* @__PURE__ */
|
|
1002
|
-
/* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ jsxs8("div", { className: "githat-form-container", children: [
|
|
1061
|
+
/* @__PURE__ */ jsxs8("div", { className: "githat-form-header", children: [
|
|
1003
1062
|
/* @__PURE__ */ jsx10("h2", { className: "githat-form-title", children: "Reset password" }),
|
|
1004
1063
|
/* @__PURE__ */ jsx10("p", { className: "githat-form-subtitle", children: "Enter your new password" })
|
|
1005
1064
|
] }),
|
|
1006
1065
|
error && /* @__PURE__ */ jsx10("div", { className: "githat-alert githat-alert-error", role: "alert", "aria-live": "polite", children: error }),
|
|
1007
|
-
/* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */
|
|
1066
|
+
/* @__PURE__ */ jsxs8("form", { onSubmit: handleSubmit, className: "githat-form", "aria-label": "Reset password form", children: [
|
|
1067
|
+
/* @__PURE__ */ jsxs8("div", { className: "githat-field", children: [
|
|
1009
1068
|
/* @__PURE__ */ jsx10("label", { className: "githat-label", htmlFor: "githat-reset-password", children: "New password" }),
|
|
1010
1069
|
/* @__PURE__ */ jsx10(
|
|
1011
1070
|
"input",
|
|
@@ -1023,7 +1082,7 @@ function ResetPasswordForm({
|
|
|
1023
1082
|
}
|
|
1024
1083
|
)
|
|
1025
1084
|
] }),
|
|
1026
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ jsxs8("div", { className: "githat-field", children: [
|
|
1027
1086
|
/* @__PURE__ */ jsx10("label", { className: "githat-label", htmlFor: "githat-reset-confirm", children: "Confirm password" }),
|
|
1028
1087
|
/* @__PURE__ */ jsx10(
|
|
1029
1088
|
"input",
|
|
@@ -1050,7 +1109,7 @@ function ResetPasswordForm({
|
|
|
1050
1109
|
}
|
|
1051
1110
|
)
|
|
1052
1111
|
] }),
|
|
1053
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ jsxs8("p", { className: "githat-powered-by", children: [
|
|
1054
1113
|
"Secured by ",
|
|
1055
1114
|
/* @__PURE__ */ jsx10("strong", { children: "GitHat" })
|
|
1056
1115
|
] })
|
|
@@ -1059,7 +1118,7 @@ function ResetPasswordForm({
|
|
|
1059
1118
|
|
|
1060
1119
|
// src/components/VerifyEmailStatus.tsx
|
|
1061
1120
|
import { useEffect as useEffect5, useState as useState9 } from "react";
|
|
1062
|
-
import { Fragment as Fragment2, jsx as jsx11, jsxs as
|
|
1121
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1063
1122
|
function VerifyEmailStatus({
|
|
1064
1123
|
token,
|
|
1065
1124
|
onSuccess,
|
|
@@ -1091,29 +1150,29 @@ function VerifyEmailStatus({
|
|
|
1091
1150
|
onError?.(err instanceof Error ? err : new Error(message));
|
|
1092
1151
|
});
|
|
1093
1152
|
}, [token, verifyEmail, onSuccess, onError, signInUrl, redirectDelay]);
|
|
1094
|
-
return /* @__PURE__ */
|
|
1095
|
-
status === "loading" && /* @__PURE__ */
|
|
1153
|
+
return /* @__PURE__ */ jsxs9("div", { className: "githat-form-container", children: [
|
|
1154
|
+
status === "loading" && /* @__PURE__ */ jsxs9("div", { className: "githat-form-header", children: [
|
|
1096
1155
|
/* @__PURE__ */ jsx11("h2", { className: "githat-form-title", children: "Verifying email..." }),
|
|
1097
1156
|
/* @__PURE__ */ jsx11("p", { className: "githat-form-subtitle", children: "Please wait while we verify your email address." })
|
|
1098
1157
|
] }),
|
|
1099
|
-
status === "success" && /* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1158
|
+
status === "success" && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1159
|
+
/* @__PURE__ */ jsxs9("div", { className: "githat-form-header", children: [
|
|
1101
1160
|
/* @__PURE__ */ jsx11("h2", { className: "githat-form-title", children: "Email verified!" }),
|
|
1102
1161
|
/* @__PURE__ */ jsx11("p", { className: "githat-form-subtitle", children: "Your email has been successfully verified. Redirecting to sign in..." })
|
|
1103
1162
|
] }),
|
|
1104
1163
|
/* @__PURE__ */ jsx11("a", { href: signInUrl, className: "githat-button githat-button-primary", style: { display: "block", textAlign: "center", textDecoration: "none" }, children: "Sign in now" })
|
|
1105
1164
|
] }),
|
|
1106
|
-
status === "error" && /* @__PURE__ */
|
|
1107
|
-
/* @__PURE__ */
|
|
1165
|
+
status === "error" && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1166
|
+
/* @__PURE__ */ jsxs9("div", { className: "githat-form-header", children: [
|
|
1108
1167
|
/* @__PURE__ */ jsx11("h2", { className: "githat-form-title", children: "Verification failed" }),
|
|
1109
1168
|
/* @__PURE__ */ jsx11("p", { className: "githat-form-subtitle", children: error })
|
|
1110
1169
|
] }),
|
|
1111
|
-
/* @__PURE__ */
|
|
1170
|
+
/* @__PURE__ */ jsxs9("p", { className: "githat-form-footer", children: [
|
|
1112
1171
|
"The link may have expired. ",
|
|
1113
1172
|
/* @__PURE__ */ jsx11("a", { href: "/sign-up", className: "githat-link", children: "Try signing up again" })
|
|
1114
1173
|
] })
|
|
1115
1174
|
] }),
|
|
1116
|
-
/* @__PURE__ */
|
|
1175
|
+
/* @__PURE__ */ jsxs9("p", { className: "githat-powered-by", children: [
|
|
1117
1176
|
"Secured by ",
|
|
1118
1177
|
/* @__PURE__ */ jsx11("strong", { children: "GitHat" })
|
|
1119
1178
|
] })
|
|
@@ -1122,7 +1181,7 @@ function VerifyEmailStatus({
|
|
|
1122
1181
|
|
|
1123
1182
|
// src/components/ChangePasswordForm.tsx
|
|
1124
1183
|
import { useState as useState10 } from "react";
|
|
1125
|
-
import { jsx as jsx12, jsxs as
|
|
1184
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1126
1185
|
function ChangePasswordForm({
|
|
1127
1186
|
onSuccess,
|
|
1128
1187
|
onError,
|
|
@@ -1162,15 +1221,15 @@ function ChangePasswordForm({
|
|
|
1162
1221
|
setIsLoading(false);
|
|
1163
1222
|
}
|
|
1164
1223
|
};
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
/* @__PURE__ */
|
|
1224
|
+
return /* @__PURE__ */ jsxs10("div", { className: "githat-form-container", children: [
|
|
1225
|
+
/* @__PURE__ */ jsxs10("div", { className: "githat-form-header", children: [
|
|
1167
1226
|
/* @__PURE__ */ jsx12("h2", { className: "githat-form-title", children: "Change password" }),
|
|
1168
1227
|
/* @__PURE__ */ jsx12("p", { className: "githat-form-subtitle", children: "Update your account password" })
|
|
1169
1228
|
] }),
|
|
1170
1229
|
success && /* @__PURE__ */ jsx12("div", { className: "githat-alert githat-alert-success", role: "status", "aria-live": "polite", children: "Password changed successfully!" }),
|
|
1171
1230
|
error && /* @__PURE__ */ jsx12("div", { className: "githat-alert githat-alert-error", role: "alert", "aria-live": "polite", children: error }),
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
1231
|
+
/* @__PURE__ */ jsxs10("form", { onSubmit: handleSubmit, className: "githat-form", "aria-label": "Change password form", children: [
|
|
1232
|
+
/* @__PURE__ */ jsxs10("div", { className: "githat-field", children: [
|
|
1174
1233
|
/* @__PURE__ */ jsx12("label", { className: "githat-label", htmlFor: "githat-change-current", children: "Current password" }),
|
|
1175
1234
|
/* @__PURE__ */ jsx12(
|
|
1176
1235
|
"input",
|
|
@@ -1187,7 +1246,7 @@ function ChangePasswordForm({
|
|
|
1187
1246
|
}
|
|
1188
1247
|
)
|
|
1189
1248
|
] }),
|
|
1190
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsxs10("div", { className: "githat-field", children: [
|
|
1191
1250
|
/* @__PURE__ */ jsx12("label", { className: "githat-label", htmlFor: "githat-change-new", children: "New password" }),
|
|
1192
1251
|
/* @__PURE__ */ jsx12(
|
|
1193
1252
|
"input",
|
|
@@ -1205,7 +1264,7 @@ function ChangePasswordForm({
|
|
|
1205
1264
|
}
|
|
1206
1265
|
)
|
|
1207
1266
|
] }),
|
|
1208
|
-
/* @__PURE__ */
|
|
1267
|
+
/* @__PURE__ */ jsxs10("div", { className: "githat-field", children: [
|
|
1209
1268
|
/* @__PURE__ */ jsx12("label", { className: "githat-label", htmlFor: "githat-change-confirm", children: "Confirm new password" }),
|
|
1210
1269
|
/* @__PURE__ */ jsx12(
|
|
1211
1270
|
"input",
|
|
@@ -1232,7 +1291,7 @@ function ChangePasswordForm({
|
|
|
1232
1291
|
}
|
|
1233
1292
|
)
|
|
1234
1293
|
] }),
|
|
1235
|
-
/* @__PURE__ */
|
|
1294
|
+
/* @__PURE__ */ jsxs10("p", { className: "githat-powered-by", children: [
|
|
1236
1295
|
"Secured by ",
|
|
1237
1296
|
/* @__PURE__ */ jsx12("strong", { children: "GitHat" })
|
|
1238
1297
|
] })
|