Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

google and github loading fix

Nitish Mahawarb95c6c374373
diff --git a/apps/web/app/app.dub.co/(auth)/login/form.tsx b/apps/web/app/app.dub.co/(auth)/login/form.tsx
index c36537b186..be50a8e1b7 100644
--- a/apps/web/app/app.dub.co/(auth)/login/form.tsx
+++ b/apps/web/app/app.dub.co/(auth)/login/form.tsx
@@ -31,11 +31,12 @@ export default function LoginForm() {
<div className="flex space-x-2">
<Button
variant="secondary"
- onClick={() => {
+ onClick={async () => {
setClickedGoogle(true);
- signIn("google", {
+ await signIn("google", {
...(next && next.length > 0 ? { callbackUrl: next } : {}),
});
+ setClickedGoogle(false);
}}
loading={clickedGoogle}
disabled={clickedEmail || clickedSSO}
@@ -43,11 +44,12 @@ export default function LoginForm() {
/>
<Button
variant="secondary"
- onClick={() => {
+ onClick={async () => {
setClickedGithub(true);
- signIn("github", {
+ await signIn("github", {
...(next && next.length > 0 ? { callbackUrl: next } : {}),
});
+ setClickedGithub(false);
}}
loading={clickedGitub}
disabled={clickedEmail || clickedSSO}
diff --git a/apps/web/app/app.dub.co/(auth)/register/form.tsx b/apps/web/app/app.dub.co/(auth)/register/form.tsx
index 64e0e6e671..22e8103cf7 100644
--- a/apps/web/app/app.dub.co/(auth)/register/form.tsx
+++ b/apps/web/app/app.dub.co/(auth)/register/form.tsx
@@ -17,22 +17,24 @@ export default function RegisterForm() {
<Button
variant="secondary"
text="Continue with Google"
- onClick={() => {
+ onClick={async () => {
setClickedGoogle(true);
- signIn("google", {
+ await signIn("google", {
...(next && next.length > 0 ? { callbackUrl: next } : {}),
});
+ setClickedGoogle(false);
}}
loading={clickedGoogle}
icon={<Google className="h-4 w-4" />}
/>
<Button
text="Continue with GitHub"
- onClick={() => {
+ onClick={async () => {
setClickedGithub(true);
- signIn("github", {
+ await signIn("github", {
...(next && next.length > 0 ? { callbackUrl: next } : {}),
});
+ setClickedGithub(false);
}}
loading={clickedGitub}
icon={<Github className="h-4 w-4" />}