Skip to content
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

[SDK-2139] Add errorPath configuration #84

Merged
merged 5 commits into from
Dec 2, 2020
Merged

Conversation

frederikprijck
Copy link
Member

@frederikprijck frederikprijck commented Nov 17, 2020

Provide a way to configure Auth0-Angular to redirect to a custom path when an error occurs as part of the login request.

  • Needs more testing to verify the removal of setTimeout doesnt break anything.

@frederikprijck frederikprijck added the review:small Small review label Nov 17, 2020
@frederikprijck frederikprijck marked this pull request as ready for review November 17, 2020 10:44
@frederikprijck frederikprijck requested a review from a team as a code owner November 17, 2020 10:44
@stevehobbsdev
Copy link
Contributor

Needs more testing to verify the removal of setTimeout doesnt break anything.

Is the PR ready to review in that case or should we hold off?

@frederikprijck frederikprijck marked this pull request as draft November 17, 2020 12:20
@frederikprijck
Copy link
Member Author

frederikprijck commented Nov 17, 2020

It is ready for review in that sense that I would love some feedback on potential edge cases that we might know that would have required the setTimeout.

It looks like callback is working fine for me. But I want to make sure.

Marked as draft, to avoid merging. But would appreciate your feedback #84 (comment)

@frederikprijck frederikprijck marked this pull request as ready for review November 18, 2020 08:35
@frederikprijck
Copy link
Member Author

Done some more testing, should be ready to go.

@rrjohnson85
Copy link

Thanks @frederikprijck! I haven't had a chance to actually test this, but it looks like it should solve #79.

Copy link
Contributor

@stevehobbsdev stevehobbsdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let's ensure the related issue is linked to the PR, or it is at least closed when the PR is merged.

@frederikprijck frederikprijck added this to the vNext milestone Dec 2, 2020
@frederikprijck frederikprijck added the CH: Added PR is adding feature or functionality label Dec 2, 2020
@frederikprijck frederikprijck merged commit ae304ec into master Dec 2, 2020
@frederikprijck frederikprijck deleted the frederik/sdk-2139 branch December 2, 2020 12:20
@cmjacques
Copy link

Hi @frederikprijck - forgive me for not opening a new issue to ask this question, but do you think it would be possible to pass the error and error_description querystring params to the errorPath URL?

The reason I ask is that I am using an Auth0 rule that prevents users from signing up using Social providers (see: https://auth0.com/rules/disable-social-signup).

I can redirect them to the error URL using the changes in this PR but I cannot see a way to pass the error and error_description querystring params which means I cannot display the appropriate error message to the user, only a generic "something went wrong" kind of error message.

Thank you,
Chris

@frederikprijck
Copy link
Member Author

Hey @cmjacques ,

Before redirecting to the error path, we emit the error in the errorSubject$: https://github.com/auth0/auth0-angular/blob/master/projects/auth0-angular/src/lib/auth.service.ts#L130

You should be able to use the error$ observable to track the error information and show an appropriate error message anywhere, including on the error page.

Let me know if that doesn't help.

@cmjacques
Copy link

Thanks for the very fast reply @frederikprijck - I will give it a go now. Cheers!

@cmjacques
Copy link

Works like a charm. Thanks again @frederikprijck. All the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Added PR is adding feature or functionality review:small Small review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants