chore: improved lastused login method (#16511)
This commit is contained in:
1 parent
fced9a6355
commit
bebe1dd7b4
2 files changed
+4
-8
No files matched your search
@@ -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 />}
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user