feat(login): add redirect parameter to login links for better user experience

This commit is contained in:
hamed
2026-07-12 10:06:15 +03:30
parent 42ac6645d5
commit 58f05f8f4f
4 changed files with 121 additions and 5 deletions
+7 -1
View File
@@ -40,7 +40,13 @@ function Content({ matchedCity, name, logged }) {
{isLogged ? (
<ProfileUser />
) : (
<Link href="/login">
<Link
href={
pathname && pathname !== "/login"
? `/login?redirect=${encodeURIComponent(pathname)}`
: "/login"
}
>
<Button variant="outlined" color="primary">
ورود | ثبت نام
</Button>