-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read property 'getStoredTransaction' of undefined #472
Comments
can you try calling parseHash without all of that and see if it works? parseHash is very important for auth0.js and Lock. I'm pretty sure we'd have been flooded with issues if it wasn't working 😅 |
I also tried to use the rxjs bindCallback method but it did not work neither. |
@luisrudge parseHash was working perfectly before hand. @FabienDehopre did you come up with a workaround for this? |
Ok. Since this is not auth0.js related, I'll close the issue. Thanks for the update @NathHorrigan 🎉 |
@NathHorrigan You wrap the call to parseHash inside an observer: const webAuth = new auth0.WebAuth({
clientID: 'XXXX',
domain: 'domain.auth0.com',
responseType: 'token id_token',
audience: 'https://your_api/',
redirectUri: `${location.protocol}//${location.host}/callback`,
scope: 'openid profile email'
});
///////////////////////////////////////////
Observable.create(observer => {
webAuth.parseHash((err, authResult) => {
if (err) {
observer.error(err);
}
else if (authResult && authResult.idToken && authResult.accessToken) {
observer.next(authResult);
}
observer.complete();
});
}); |
Hey there everyone! It turns out you can use To use // auth.service.ts
private _Auth0 = new auth0.WebAuth({
clientID: 'XXXX',
domain: 'domain.auth0.com',
responseType: 'token id_token',
audience: 'https://your_api/',
redirectUri: `${location.protocol}//${location.host}/callback`,
scope: 'openid profile email'
});
// Create observable of Auth0 parseHash method to gather auth results
parseHash$ = bindNodeCallback(this._Auth0.parseHash.bind(this._Auth0)); Note that when you subscribe to an observable created by this.parseHash().subscribe(authResult => {
// Store the token, clear the hash, etc.
}); In plain old JavaScript, you should be able to bind the The same pattern will work with Hope that helps! |
I'm using binding the parseHash function to RxJS and Redux-Observable and I'm getting the following error (I'm pretty sure its Auth0.js related but I could be wrong):
Here is my function call:
The text was updated successfully, but these errors were encountered: