-
-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verifier implementation #978
Comments
Yes there should be and the use id should really be included in the tokens |
@daffl Hi! I have a problems follow this docs trying create my custom import local, { Verifier } from '@feathersjs/authentication-local';
class CustomVerifier extends Verifier {
//Custom code
} import local, { Verifier } from '@feathersjs/authentication-local';
^^^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:656:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (C:\xampp\htdocs\api-feathers\src\app.js:22:24)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3) The only way to make my custom
const local = require('@feathersjs/authentication-local');
class CustomVerifier extends local.Verifier {
//Custom code
} |
It is indeed, I updated the docs. |
The same with JWT Verifier. Pull request: #1276 in docs. |
Setting the |
Hi and thanks for the framework,
I need to customize my
local
authentication strategy. For that I can provide a subclass oflocal.Verifier
with a customverify
method. The problem is that in this method I need to return the token payload, and if I don't use the form{ [`${this.options.entity}Id`]: id }
like in the default one, it won't be working with thejwt.Verifier
class used by thejwt
strategy (among other since it looks like each strategy module gets its ownVerifier
class).Should there be a single source of truth for this ? Like somewhere a unique (possibly also overridable) function
entity => jwtPayload
?Am I missing something ?
Cheers
The text was updated successfully, but these errors were encountered: