Page Reload Issue
See original GitHub issueHey, just installed this package, and I’m having an issue where the page is refreshed, the user object doesn’t seem to be getting fetched from the session.
Effectively doing something like the following and on page refresh, userData
doesn’t seem to be getting set (or at least triggering a rerender).
Thanks in advance.
import React from 'react';
import { useAuth } from 'oidc-react';
export const AuthButton: React.FC = () => {
const auth = useAuth();
if (!auth.userData) {
return (
<button onClick={() => auth.signIn()}>log in</button>
);
}
return (
<button onClick={() => auth.signOut()}>log out</button>
);
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
A problem occurred with this webpage so it was reloaded, fix
This one is weird but often is the source of trouble for a variety of issues, including this error. Go to Settings >...
Read more >How to Fix “This Webpage Was Reloaded Because a Problem ...
This error can be caused by a number of issues, and it's hard to diagnose the exact cause. The most common causes are...
Read more >How to fix 'a problem repeatedly occurred' in Safari - MacPaw
1. Restart Safari · 2. Check for updates · 3. Check other websites · 4. Close browser tabs your not using · 5....
Read more >location.reload() - Web APIs | MDN
The reload may be blocked and a SECURITY_ERROR DOMException thrown. This happens if the origin of the script calling location.reload() differs ...
Read more >Simple steps to refresh your web browser cache
Simply, On windows Press Ctrl+F5 and On Mac press Option+⌘ Command+E to empty your cache, and then ⌘ Command+R to refresh the page....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello,
Thank you for the issue! You have covered you app with
<AuthProvider>
?Let me test this out on my test repository.
Hey, I ended up switching to
react-oidc
, thanks again!