Skip to content

[BUG] redirect in AuthProvider.check won't work on safari #6703

Open
@erandr

Description

@erandr

Describe the bug

Redirecting to another page via AuthProvider check function won't work on safari, the code below works on safari only when adding a delay. On chrome the code works without the delay

Steps To Reproduce

check: async () => {

const userInfo = JSON.parse(userInfoString);
            const redirectPath = getRedirectPath(userInfo);

            // Ensure any pending events or promises are processed or otherwise the redirect will not work on webkit browsers  (safari)
            await new Promise(resolve => setTimeout(resolve, 100));

            return {
                authenticated: true,
                redirectTo: redirectPath,
            }; }

Expected behavior

Redirection should work without having to add a delay inside check function

Packages

"@refinedev/antd": "^5.45.1",
"@refinedev/cli": "^2.16.42",
"@refinedev/core": "^4.57.1",
"@refinedev/devtools": "^1.2.12",
"@refinedev/inferencer": "^4.7.1",
"@refinedev/kbar": "^1.3.14",
"@refinedev/react-router-v6": "^4.6.2",
"@refinedev/simple-rest": "^4.5.4",

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions