chore: improved lastused login method (#16511)

This commit is contained in:
Anik Dhabal Babu authored and GitHub committed 2024-09-05 23:19:24 +05:30
1 parent fced9a6355
commit bebe1dd7b4
2 files changed
+4 -8

No files matched your search

+2 -4
View File
@@ -256,12 +256,10 @@ PageProps & WithNonceProps<{}>) {
CustomStartIcon={<GoogleIcon />}
onClick={async (e) => {
e.preventDefault();
const res = await signIn("google", {
setLastUsed("google");
await signIn("google", {
callbackUrl,
});
if (res && !res.error) {
setLastUsed("google");
}
}}>
<span>{t("signin_with_google")}</span>
{lastUsed === "google" && <LastUsed />}
+2 -4
View File
@@ -26,10 +26,8 @@ export function SAMLLogin({ samlTenantID, samlProductID, setErrorMessage }: Prop
const mutation = trpc.viewer.public.samlTenantProduct.useMutation({
onSuccess: async (data) => {
const res = await signIn("saml", {}, { tenant: data.tenant, product: data.product });
if (res && !res.error) {
setLastUsed("saml");
}
setLastUsed("saml");
await signIn("saml", {}, { tenant: data.tenant, product: data.product });
},
onError: (err) => {
setErrorMessage(t(err.message));