Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

return url and afteractivationurl #93

Open
ajefts opened this issue May 2, 2017 · 14 comments
Open

return url and afteractivationurl #93

ajefts opened this issue May 2, 2017 · 14 comments

Comments

@ajefts
Copy link
Contributor

ajefts commented May 2, 2017

Right now, we hard code the retUrl and afterActivationURL in the accounts app. This means that the user is always sent back to the main my-dashboard page. This doesn't work well for situations when the user is starting on another site/page, like cognitive.topcoder.com and we want to keep them on that site.

Let's add support for the following:

  1. After the user registers, return them to the page they came from. We should be able to support this if we make the retUrl work on the register links. For example, https://accounts.topcoder.com/member/registration?retURL=https://cognitive.topcoder.com would return to https://cognitive.topcoder.com after the registration form was submitted.

  2. When the user activates their account, direct them back to a specified URL. I see the /users api supports an "afterActivationURL" param that handles this. However, the accounts app does not support this. The requirement to to have the activation link in the activation email included a custom retUrl. For example, https://api.topcoder.com/pub/activation.html?code=123KJHH&retUrl=https://cognitive.topcoder.com

@ajefts
Copy link
Contributor Author

ajefts commented May 2, 2017

@vikasrohit Hoping you can help with this one?

@vikasrohit
Copy link

Yes, I can help with 1, however, I doubt for 2 we would need changes in identity service.

@vikasrohit
Copy link

@ajefts for 1 Once user registers, it should send, as per current implementation, user to /skill-picker not dashboard. Do we want to skip going to skill-picker page after registration in such cases?

@ajefts
Copy link
Contributor Author

ajefts commented May 3, 2017 via email

@ajefts
Copy link
Contributor Author

ajefts commented May 3, 2017

@vikasrohit for 2, are you sure it would require identity service changes? I see the ios.topcoder.com site it using it here: https://github.com/appirio-tech/ap-lime-topcoder/blob/b30351fee5c2cc5f1ffa35b6ea27e82b34c5d5e4/app/services/auth.service.coffee#L38

@vikasrohit
Copy link

Deployed changes for 2 to dev. On 1, we currently do not redirect user anywhere after successful registration. We are showing this page to the user:
screen shot 2017-05-04 at 12 35 36 pm
Are you thinking to redirect to some other page instead of showing this page? If yes, how would we show the successful registration message to the user in that case?

@vikasrohit
Copy link

@ajefts Did you get chance to look at it?

@ajefts
Copy link
Contributor Author

ajefts commented May 8, 2017

Hi @vikasrohit. If there is a redirect URL, then we will send the user to the provided URL instead of the default success page above.

@vikasrohit
Copy link

vikasrohit commented May 9, 2017

Okay. Let check it again.

UPDATE: So we have to use the same return url (passed as retUrl param in query string) for both redirections i.e. page to be redirected after successful registration and page to be redirected after successful activation of the account?

@vikasrohit
Copy link

bump 😬

@ajefts
Copy link
Contributor Author

ajefts commented May 10, 2017

Sorry. Yes, your statement is correct. The retUrl would be used in both places. Do you see an issue with that?

@vikasrohit
Copy link

Yes, there will be a problem. When we want the user to be redirected to a page after activation, which requires an activated account (which would mostly be the case), it would redirect user to that same page even after successful registration and in that case user may get errors as the page requires an activated user account.

@ajefts
Copy link
Contributor Author

ajefts commented May 11, 2017

I might be a little confused, but let me try to elaborate on what I'm thinking:

  1. We have our normal current flow for standard registration. No retUrl is provided. Instead, we have default landing pages specified for registration success and activation success. I'm not looking to change this at all.

  2. I'm looking to add an option that IF the retUrl is specified in the registration page, then it would send the user to that page after registration (instead of the current registration success page) and after activation (instead of the current skill picker).

I can see the potential issue with skipping the skill picker since that is were we're asking them to opt-in for notifications. Maybe we could send them to the skill picker and then forward them to the retUrl after you click Done on the skill picker page?

In terms of not being activated and visiting a page prior to activation, I'm ok with that.

@vikasrohit
Copy link

Hey @ajefts, sorry to reply too late. However, I just landed here today while cleaning up my stale branches in accounts-app. As discussed I have deployed #94 changes to dev (and I guess dev is deployed to prod as well) which handles only one portion of this issue which is to redirect user to a custom page(instead of skill picker) after successful activation. Further, this is only done for the members app, not for the connect app.

Regarding the skipping of skill picker page, I guess, your idea can work if we update the skill picker page to accept a return url and direct user to that page on click of Done. Do you want me to do those changes?

Now coming to my concern about using the same URL for both registration success and activation success. It still remains same for me. Even if we are okay with having a user visiting a page without being activated, the issue is that the page might be calling an API which requires activated user which would fail in such cases. If we are okay with that or mostly our return urls won't be calling an API, we can use the same URLs for both cases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants