Comments (5)
@pherrmann Thanks for submitting an issue!
If you end up submitting a PR for this issue then I'd be happy to look at it.
Otherwise I'll try to look into it sometime this week.
from salte-auth.
I don't immediately have a solution. I'll submit a PR if one comes to me.
The state mismatch alerted me in a round-a-bout way that a second login was occurring while the first one was being processed.
Perhaps, it could check to make sure it's not already processing a login when it falls into the $$onRouteChanged flow. $$onRouteChanged appears to be bound to document 'click' and window 'popstate' events
from salte-auth.
Created a small demo showcasing the issue out on Glitch.
Demo
https://salte-auth-135.glitch.me
Steps to Reproduce
- Enable persistent logs in Chrome (so that the error doesn't get lost)
- Hit here to clear your cache for that site.
- Navigate to the mini-app.
- Login
- At this point the error SHOULD occur.
from salte-auth.
@pherrmann Let me know if v2.1.3 resolves the issue you were seeing!
from salte-auth.
@cecilia-sanare Your update is an improvement as it's no longer calling login twice. However, it appears I'm ending up with the same issue for a different reason.
After avoiding the extra loginWithIframe call, retrieveAccessToken goes on to make a call to retrieve the access token. This calls $accessTokenUrl which updates the profile's $localState to a new uuid. This results in a state mismatch error and an extra call to retrieve the access token.
Could $$onRouteChanged check for login promises before calling retrieveAccessToken?
$$onRouteChanged() {
if (!this.$utilities.isRouteSecure(location.href, this.$config.routes)) return;
if(!this.$promises.login) { // don't retrieve access token while logging in
this.retrieveAccessToken();
}
}
from salte-auth.
Related Issues (20)
- An in-range update of http-server is breaking the build 🚨 HOT 1
- An in-range update of @polymer/polymer is breaking the build 🚨 HOT 1
- Find a tool to validate documentation coverage for TypeScript
- Atom auto-complete / intellisense
- Error importing .mjs in Angular (Typescript) HOT 7
- (3.x) Add support for custom parameters HOT 2
- (3.x) Generated API Doc links don't work HOT 6
- (3.x) Improve generated documentation
- invalid_state with redirect login while popup login works with same config HOT 8
- @salte-auth/salte-auth: TypeScript users shouldn't have to validate the Provider type. HOT 4
- Convert Tests to TypeScript
- UserInfo should support non-standard properties HOT 1
- redirectUrl set as RedirectUrl INTERFACE object not working HOT 3
- salte.SalteAuth is not a constructor on Glitch demo HOT 2
- Figure out why SauceLabs refuses to connect
- @salte-auth/salte-auth: Custom `state` parameter
- @salte-auth/popup: Promise should be rejected when popup is closed
- Sveltekit / Server-side Rendering Support HOT 4
- Cannot run yarn successfully HOT 1
- Custom storage guide HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from salte-auth.