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.

isLoggedIn Return False When refresh the page with F5 or the browser's Refresh button.

See original GitHub issue
- [x] bug report -> please search for issues before submitting
- [ ] feature request

Versions.

“keycloak-angular”: “^7.2.0”, “@angular/core”: “~8.0.3”,
Server Version 8.0.1

Repro steps.

Initially, I am correctly logged into my application.

I am trying to access a path protected by a Guard, and the state of this.authenticated variable is true, for now everything works fine.

But after accessing the page and when I refresh the entire page with F5 or with the refresh button of the browser, the variable this.authenticated is false. It also fails when I manually type the url in the address bar.

The log given by the failure.

Desired functionality.

Should acces or allow navigate to paths that have the Guard implemented. The Guard should recognize that the variable this.authenticate its in true when refresh entire page.

1 2 3 4

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
neilhemcommented, Aug 23, 2020

I confirm that initialNavigation: 'enable' causes getting always authenticated as false in AuthGuard

1reaction
jonkoopscommented, Jul 30, 2020

@catapulveda Interesting, I had not heard of this option before but it makes sense this code would break because of this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable F5 and browser refresh using JavaScript
On a side note: This only disables the f5 button on the keyboard. To truly disable refresh you must use a server side...
Read more >
Disable F5 Key (Button) And Browser Refresh ... - C# Corner
In this blog, I will share a trick to prevent the user refreshing the Browser, using Keyboard F5 function key by disabling F5...
Read more >
Browser Refresh handling in GWT - Google Groups
I'm logged in and if I hit F5 I stay logged in. There has to be a session cookie and the app checks...
Read more >
Prevent refresh to login - Get Help - Vue Forum
You can, in theory, intercept the F5 button refresh but writing an event ... so when the page is refreshed authenticated returns to...
Read more >
How to refresh a page using jQuery? - GeeksforGeeks
reload () method reloads the current web page emulating the clicking of the refresh button on the browser. The optional true parameter passed...
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