Skip to content

getCredentials on Auth0ContextInterface has wrong signature #1323

@AntoninoGitto

Description

@AntoninoGitto

Hello,
I've noticed that the getCredentials method exposed on the Auth0ContextInterface

/**
* Retrieves the stored credentials, refreshing them if necessary.
* @param scope The scopes to request for the new access token (used during refresh).
* @param minTtl The minimum time-to-live (in seconds) required for the access token.
* @returns A promise that resolves with the user's credentials.
* @throws {AuthError} If credentials cannot be retrieved or refreshed.
*/
getCredentials(scope?: string, minTtl?: number): Promise<Credentials>;

doesn't match the implementation signature on Auth0Provider.
const getCredentials = useCallback(
async (
scope?: string,
minTtl?: number,
parameters?: Record<string, unknown>,
forceRefresh?: boolean
) => {

This causes a ts error when using the method with the extra params, that in my case are needed since the authentication was triggered with those extra params.

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