feat: persist customer product and shop favorites through the live API
Replace mall fixture favorites with customer-scoped endpoints, and send signed-out shoppers back to the page they left after sign-in. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
94a64ec712
commit
6c1357ec4d
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Sign-in URL that returns the shopper to `fullPath` afterwards. `login.vue`
|
||||
* only honours a same-origin absolute path, and a redirect back to the sign-in
|
||||
* page itself would loop, so that case drops the parameter.
|
||||
*/
|
||||
export function signInPath(fullPath: string): string {
|
||||
if (!fullPath.startsWith("/") || fullPath.startsWith("//") || fullPath.startsWith("/login")) {
|
||||
return "/login";
|
||||
}
|
||||
return `/login?redirect=${encodeURIComponent(fullPath)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user