Skip to content

Redirect path in logout #713

Closed
Closed
@tiphaineruy

Description

@tiphaineruy

Issue and Steps to Reproduce

logout doesn't expose a callback uri option:

export declare const useOidc: (configurationName?: string) => {
    login: (callbackPath?: any) => any;
    logout: () => any;
    isLogged: boolean;
};
export declare const useOidcAccessToken: (configurationName?: string) => any;
export declare const useOidcIdToken: (configurationName?: string) => any;
//# sourceMappingURL=ReactOidc.d.ts.map

Versions

4.2.3

Screenshots

Expected

    login: (callbackPath?: any) => any;
    logout: (callbackPath?: string) => any;

Is there something else than appending the callbackPath to the logout endpoint that i'm missing ?


in oidc.ts
line 434

    async logoutAsync() { <--- HERE
        const oidcServerConfiguration = await this.initAsync(this.configuration.authority);
        // TODO implement real logout
        await this.destroyAsync();  
        window.location.href = oidcServerConfiguration.endSessionEndpoint; <-- Add redirect
    }

Actual

Additional Details

I can open a PR for that If you want.

  • Installed packages:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions