Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit 5624b13

Browse files
committed
FIX: logging in via external stores user object in vuex along with faunaDB token
1 parent bebc7d2 commit 5624b13

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

functions/identity-external-signup.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ function handler(event, context, callback) {
105105

106106
console.log("admin url check", usersUrl)
107107

108+
109+
//TODO - check if user already exists in db
110+
// if so send the current netlify user object
111+
108112
const password = generator.generate({
109113
length: 10,
110114
numbers: true

src/components/DevPanel.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
<li> Current_Email : {{currentUser.email}} </li>
1111
<li> app_metadata : {{currentUser.app_metadata}} </li>
1212
<li> user_metadata : {{currentUser.user_metadata}} </li>
13-
<li> netlify JWT : {{currentUser.token.access_token}} </li>
13+
<!-- no access token available when signing up externaly
14+
<li> netlify JWT : {{currentUser.token.access_token}} </li> -->
1415
</ul>
1516

1617
<button @click="updateUserMetaData">Update user meta data</button>

src/store/modules/auth.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,13 @@ export default {
125125
console.log("user meta ", user.user_metadata)
126126
console.log("JWT ", params.access_token)
127127

128+
//TODO: do these then blocks need to be nested like this?
128129
invokeSignupFunction(user.id ,user.user_metadata,params.access_token)
129-
.then((resp) => {
130+
.then((resp) => resp.json())
131+
.then(resp => {
130132
console.log("response back", resp)
131-
console.log("seeting current user to state, ", Auth.currentUser())
132-
commit("SET_CURRENT_USER", Auth.currentUser())
133+
console.log("seeting current user to state, ", resp.data)
134+
commit("SET_CURRENT_USER", resp.data)
133135
})
134136
.catch(error => {console.error("problem with external signup function" , error)})
135137

0 commit comments

Comments
 (0)