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 has been archived by the owner on Mar 22, 2022. It is now read-only.
I have been trying to override app.set('auth', authOptions); and app.set('authentication', authOptions);. Which none have worked authenticate('jwt') already stores what authOptions it cares about already. I could pass in the authenticate('jwt', OPTIONS_HERE), but would have to delay the whole process just to wait for the promise to return for the key.
Possibly I am going about this the wrong way.
This is how I am trying to get my key.
constDatastore=require('@google-cloud/datastore');constdatastore=newDatastore();datastore.runQuery(datastore.createQuery('Settings').select('MY_SECRET')).then((res)=>{console.log('Successfully loaded secret');constauthOptions=app.get('authentication');// This doesn't using the proper secret when trying to verify JWT tokenauthOptions.secret=res[0][0]['MY_SECRET'];app.set('auth',authOptions);app.set('authentication',authOptions);console.log('New secret:',app.get('authentication').secret);})
Expected behavior
The new secret should be used to throughout feathers app.
Actual behavior
The secret that was loaded in at runtime isn't being used since authenticate was called prior to loading the secret and didn't want to slow down the rest of the process.
System configs were omitted since this seems more like how do you really do it than a properly with feathers.
The text was updated successfully, but these errors were encountered:
Yes, that is what I did originally and which is why the code above goes as far as to even set back the authOptions by setting it directly via app.set.
The reason why I believe it isn't working is every time I use the above code and try to use the endpoints which require jwt I always get NotAuthenticated: invalid signature. Which leads me to believe the secrets aren't matching when the hook is set using authenticate('jwt'). The secret in there is different from when I set it later.
Feathers v4 authentication supports dynamically setting options in a single place and at runtime.
Please see the migration guide for more information. Closing this issue in order to archive this repository. Related issues can be opened at the new code location in the Feathers main repository.
Steps to reproduce
I have been trying to override
app.set('auth', authOptions);
andapp.set('authentication', authOptions);
. Which none have workedauthenticate('jwt')
already stores what authOptions it cares about already. I could pass in theauthenticate('jwt', OPTIONS_HERE)
, but would have to delay the whole process just to wait for the promise to return for the key.Possibly I am going about this the wrong way.
This is how I am trying to get my key.
Expected behavior
The new secret should be used to throughout feathers app.
Actual behavior
The secret that was loaded in at runtime isn't being used since authenticate was called prior to loading the secret and didn't want to slow down the rest of the process.
System configs were omitted since this seems more like how do you really do it than a properly with feathers.
The text was updated successfully, but these errors were encountered: