We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c9ccd5 commit 3d4e857Copy full SHA for 3d4e857
webapp/store/auth.js
@@ -18,17 +18,15 @@ export const mutations = {
18
export const actions = {
19
init({ commit, dispatch }) {
20
this.$netlifyIdentity.on('init', (user) => {
21
- setTimeout(() => {
22
if (user) {
23
- commit('setUser', {
24
- username: user.user_metadata.full_name.toLowerCase(),
25
- email: user.email,
26
- id: user.id,
27
- })
28
- } else {
29
- dispatch('open', 'login');
30
- }
31
- }, 500);
+ commit('setUser', {
+ username: user.user_metadata.full_name.toLowerCase(),
+ email: user.email,
+ id: user.id,
+ })
+ } else {
+ dispatch('open', 'login');
+ }
32
})
33
this.$netlifyIdentity.on('close', () => {
34
const user = this.$netlifyIdentity.currentUser();
0 commit comments