react-oidc-context icon indicating copy to clipboard operation
react-oidc-context copied to clipboard

Safari download an empty logout file when I use signoutSilent method

Open gregoirebyvets opened this issue 2 years ago • 6 comments

Hello guys,

I'm quite newbie with oidc and I have an issue that I dont understand.

On Safari, when a user click on the "Logout" button (wich use signoutSilent() ), the browser ask if I want to download the "logout" file (from Keycloak logout url)

Do you know why I'm facing this ?

Thanks

gregoirebyvets avatar Aug 17 '23 10:08 gregoirebyvets

do you have a onClick handler? Can you dump your ui button code here?

pamapa avatar Aug 17 '23 12:08 pamapa

Here is my ui button code.

<HeaderButton onClick={() => auth.signoutSilent()}> Log out </HeaderButton>

And auth is provided by this line

const auth = useAuth();

gregoirebyvets avatar Aug 17 '23 12:08 gregoirebyvets

How does it look like rendered is it a <a> tag, which Safari reacts with download. Maybe try something else?

pamapa avatar Aug 17 '23 12:08 pamapa

It's actually a button:

<button tabindex="-1" class="bg-trinidad-500 font-normal text-white rounded-full px-3 py-2 mx-2 lg:px-6 lg:py-2 lg:mx-2 text-sm lg:text-base">Log out</button>

gregoirebyvets avatar Aug 17 '23 12:08 gregoirebyvets

no idea, you will need to track it down, does that button + onClick with a console.log("aha") and no auth.signoutSilent() also trigger the download?

pamapa avatar Aug 17 '23 13:08 pamapa

Ok thanks for your help, I'll investigate deeper and give a feedback if I find anything relevant

gregoirebyvets avatar Aug 17 '23 13:08 gregoirebyvets