Skip to content

Commit c2a6941

Browse files
committed
login page s hould redirect to account
1 parent 10a22c3 commit c2a6941

File tree

1 file changed

+1
-4
lines changed
  • packages/template-retail-react-app/app/pages/login

1 file changed

+1
-4
lines changed

packages/template-retail-react-app/app/pages/login/index.jsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ const Login = ({initialView = LOGIN_VIEW}) => {
7575
const [currentView, setCurrentView] = useState(initialView)
7676
const [passwordlessLoginEmail, setPasswordlessLoginEmail] = useState('')
7777
const [loginType, setLoginType] = useState(LOGIN_TYPES.PASSWORD)
78-
let locatedFrom
7978

8079
const handleMergeBasket = () => {
8180
const hasBasketItem = baskets?.baskets?.[0]?.productItems?.length > 0
@@ -110,8 +109,6 @@ const Login = ({initialView = LOGIN_VIEW}) => {
110109

111110
const handlePasswordlessLogin = async (email) => {
112111
try {
113-
// Save the path where the user logged in
114-
window.localStorage.setItem('returnToPage', window.location.pathname)
115112
await authorizePasswordlessLogin.mutateAsync({userid: email})
116113
setCurrentView(EMAIL_VIEW)
117114
} catch (error) {
@@ -173,7 +170,7 @@ const Login = ({initialView = LOGIN_VIEW}) => {
173170
useEffect(() => {
174171
if (isRegistered) {
175172
handleMergeBasket()
176-
locatedFrom = window.localStorage.getItem('returnToPage')
173+
const locatedFrom = window.localStorage.getItem('returnToPage')
177174
if (locatedFrom) {
178175
navigate(locatedFrom)
179176
} else {

0 commit comments

Comments
 (0)