Hi.
The state is set for you in Strategy.prototype.authorizationParams. You can override this by setting state to true. This works fine in typeless JS. But in TS the types don't allow this: passport.authenticate('apple', {state: true}).
The Google version has this:
// allow Google-specific options when using "google" strategy
declare module "passport" {
interface Authenticator<
InitializeRet = express.Handler,
AuthenticateRet = any,
AuthorizeRet = AuthenticateRet,
AuthorizeOptions = passport.AuthenticateOptions,
> {
authenticate(
strategy: "google",
options: AuthenticateOptionsGoogle,
callback?: (...args: any[]) => any,
): AuthenticateRet;
authorize(
strategy: "google",
options: AuthenticateOptionsGoogle,
callback?: (...args: any[]) => any,
): AuthorizeRet;
}
}
I hope this helps.
Hi.
The state is set for you in
Strategy.prototype.authorizationParams. You can override this by settingstateto true. This works fine in typeless JS. But in TS the types don't allow this:passport.authenticate('apple', {state: true}).The Google version has this:
I hope this helps.