Skip to content

Authorization params update the incoming parameters. #57

Description

@Bunpasi

Currently Strategy.authorizationParams sets the outgoing params to the incoming options. In passport-oauth2\lib\strategy.js on line 276 in the function stored we find if (state) { params.state = state; }. Because options and params are now the same object, the global state is now set to the state of a single user. This breaks the code for the next OAuth request when it reaches line 256 if (state && typeof state == 'string') {. I've rewritten the function. Hopefully you can use this.

Strategy.prototype.authorizationParams = function (options: AppleAuthorizationParams)
{
    return {
        state: options.state ?? randomBytes(5).toString('hex'),
        response_type: options.response_type ?? "code id_token",
        scope: options.scope ?? "name email",
        response_mode: options.response_mode ?? "form_post",
    };
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions