-
-
Notifications
You must be signed in to change notification settings - Fork 347
Open
Description
The google client code, returns an accessToken, refreshToken, and the result itself. Which now returns the idToken, or at least in my case. The way to get that back id to read the "params".
For that this library attempts to check the arity but because of the many layers of passport it proves to be a bad interface choice. Passport can apply a mixin, in which case the callback has zero parameters during runtime. Effectively breaking this code:
var arity = self._verify.length;
if (arity == 5) {
self._verify(accessToken, refreshToken, params, profile, verified);
} else { // arity == 4
self._verify(accessToken, refreshToken, profile, verified);
}
the solution really is to do away with the arity and leave the optional parameters to the end. To avoid breaking changes you could do something like this:
var arity = self._verify.length;
if (legacyCheck && arity == 5) {
self._verify(accessToken, refreshToken, params, profile, verified);
} else (legacyCheck) { // arity == 4
self._verify(accessToken, refreshToken, profile, verified);
} else {
self._verify(accessToken, refreshToken, profile, verified, params);
}
Ideally legacyCheck
is a configuration variable so that users can keep the old behavior. The biggest issue is the typescript types.
xenia-lang
Metadata
Metadata
Assignees
Labels
No labels