This commit is contained in:
Timur Ercan
2023-03-09 13:14:11 +01:00
parent 615c9bc880
commit 7eaa21fc1e

View File

@ -30,8 +30,6 @@ export default function Login() {
// If not absolute URL, make it absolute // If not absolute URL, make it absolute
if (!/^https?:\/\//.test(callbackUrl)) { if (!/^https?:\/\//.test(callbackUrl)) {
if (process.env.NODE_ENV !== "production") {
}
callbackUrl = `${NEXT_PUBLIC_WEBAPP_URL}/${callbackUrl}`; callbackUrl = `${NEXT_PUBLIC_WEBAPP_URL}/${callbackUrl}`;
} }
@ -58,12 +56,10 @@ export default function Login() {
setErrorMessage("Error"); setErrorMessage("Error");
toast.dismiss(); toast.dismiss();
toast.error("Something went wrong."); toast.error("Something went wrong.");
} } else if (!res.error) {
else if (!res.error) {
// we're logged in, let's do a hard refresh to the original url // we're logged in, let's do a hard refresh to the original url
router.push(callbackUrl); router.push(callbackUrl);
} } else {
else {
toast.dismiss(); toast.dismiss();
if (res.status == 401) { if (res.status == 401) {
toast.error("Invalid email or password."); toast.error("Invalid email or password.");