passport-apple icon indicating copy to clipboard operation
passport-apple copied to clipboard

Types don't allow state to be set.

Open Bunpasi opened this issue 2 months ago • 0 comments

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.

Bunpasi avatar Nov 29 '24 06:11 Bunpasi