You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 22, 2022. It is now read-only.
I also found that options.idField parameter is not actually used. It should be like this:
/** * Populate the current user associated with the JWT */constdefaults={userEndpoint: '/users',passwordField: 'password',idField: '_id'};exportdefaultfunction(options={}){options=Object.assign({},defaults,options);returnfunction(hook){// If we already have a current user just pass throughif(hook.params.user){returnPromise.resolve(hook);}letid;// If it's an after hook grab the id from the resultif(hook.type==='after'){id=hook.result[options.idField];}// Check to see if we have an id from a decoded JWTelseif(hook.params.payload){id=hook.params.payload[options.idField];}// If we didn't find an id then just pass throughif(id===undefined){returnPromise.resolve(hook);}returnnewPromise(function(resolve,reject){hook.app.service(options.userEndpoint).get(id,{}).then(user=>{// attach the user to the hook for use in other hooks or serviceshook.params.user=user;// If it's an after hook attach the user to the responseif(hook.result){hook.result.data=Object.assign({},user=!user.toJSON ? user : user.toJSON());// format responsedeletehook.result[options.idField];deletehook.result.data[options.passwordField];}returnresolve(hook);}).catch(reject);});};}
This hook do not get settings for
local auth
from myconfig/default.json
.I have added configuration to default.json file.
And i passed settings to feather-authentication:
The text was updated successfully, but these errors were encountered: