简体   繁体   中英

NodeJS : How to redirect to a different domain name from a route

I am building a MEAN Stack application and my API runs on app.example.com and my frontend runs on web.example.com .
I am trying to build an email verification system, which will send an email to the user. The link I send is app.example.com/email-verification/${URL} which is one of my routes in my application. After verifying the user I want him to go (in frontend) from web.example.com/login (Mind you this is angular's routing) to web.example.com/dashboard . How do I achieve this? Is this actually possible?

I hope I understand the question, but I think it's pretty simple:

$location.path('/dashboard');

User fills the form (Angular-front) -> User clicks the email (In the url you can put a param with the email encripted) -> The controller check the param and call to the NODE API method that verify email -> When angular front get a successful response from api : Login method and $location.path('/dashboard');

Sorry my english :P

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM