question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Page Reload Issue

See original GitHub issue

Hey, 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:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cobrazcommented, Apr 21, 2020

Hello,

Thank you for the issue! You have covered you app with <AuthProvider>?

Let me test this out on my test repository.

0reactions
jspizziricommented, May 16, 2020

Hey, I ended up switching to react-oidc, thanks again!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found