I'm not sure this is an issue or just me being in the dark.
I have a registration page which should communicate with the feathers backend unauthorised (the user has still to be made).
When dispatching to
this.$store.dispatch('users/create', {})
the client reports an error
TypeError: Cannot convert undefined or null to object
populate-access-token.js:9
at Function.assign ()
at Object.eval (webpack-internal:///./node_modules/@feathersjs/authentication-client/lib/hooks/populate-access-token.js:9:12)
at promise.then.hookObject (webpack-internal:///./node_modules/@feathersjs/commons/lib/hooks.js:142:73)
This is correct, since the call to app.get('accessToken') will result in undefined.
I'm not sure this is an issue or just me being in the dark.
I have a registration page which should communicate with the feathers backend unauthorised (the user has still to be made).
When dispatching to this.$store.dispatch('users/create', {})
the client reports an error
TypeError: Cannot convert undefined or null to object populate-access-token.js:9 at Function.assign ()
at Object.eval (webpack-internal:///./node_modules/@feathersjs/authentication-client/lib/hooks/populate-access-token.js:9:12)
at promise.then.hookObject (webpack-internal:///./node_modules/@feathersjs/commons/lib/hooks.js:142:73)
This is correct, since the call to app.get('accessToken') will result in undefined.
After updating populate-access-token.js to
: if (app.get('accessToken')) { Object.assign(hook.params, { accessToken: app.get('accessToken') }); } :
the code seems to work as I want.
I'm thinking this is not the way to do this. Surely this is a common use case, so what am I missing here? Any advice is appreciated.