Commit c386933df62971eefffc2d1f5e1a0e344a911f9c
1 parent
2991bacc1d
Exists in
master
login with email flow
Showing
1 changed file
with
8 additions
and
3 deletions
Show diff stats
src/components/LandingPage.vue
... | ... | @@ -142,7 +142,7 @@ export default { |
142 | 142 | // localStorage.removeItem("spotlight_email"); |
143 | 143 | var userdata = localStorage.getItem("spotlight_usertoken"); |
144 | 144 | var userid = localStorage.getItem("spotlight_id"); |
145 | - if (userdata) { | |
145 | + if (userdata && userid) { | |
146 | 146 | // this.$router.push("/profile"); |
147 | 147 | this.$router.push({ |
148 | 148 | name: "Profile", |
... | ... | @@ -169,15 +169,20 @@ export default { |
169 | 169 | console.log("login- response", response); |
170 | 170 | this.$toaster.success(response.data.message); |
171 | 171 | if (response.data.status == "success") { |
172 | + console.log("--1-") | |
172 | 173 | localStorage.setItem( |
173 | 174 | "spotlight_usertoken", |
174 | 175 | JSON.stringify(response.data.data) |
175 | 176 | ); |
176 | - localStorage.setItem("spotlight_id", res.data.data.id); | |
177 | + console.log("--2-") | |
178 | + | |
179 | + localStorage.setItem("spotlight_id", response.data.data.id); | |
180 | + console.log("--3-") | |
181 | + | |
177 | 182 | this.$router.push({ |
178 | 183 | name: "Profile", |
179 | 184 | params: { |
180 | - id: res.data.data.id, | |
185 | + id: response.data.data.id, | |
181 | 186 | }, |
182 | 187 | }); |
183 | 188 | } | ... | ... |