score:3
Accounts.urls.verifyEmail
function takes in a token parameter, so you can do the following:
Accounts.urls.verifyEmail = function(token) {
return Meteor.absoluteUrl("restaurantsignin?token="+token)
}
Then the user clicks on the link in the email the token is already in the query param which you can extract with this.props.location.query.token
. So in your RestaurantSignIn
component's componentWillMount
you can call:
Accounts.verifyEmail(this.props.location.query.token, function(error) {...})
If there are no errors you can navigate directly to an authenticated route with this.props.history.replace('/dashboard')
because Accounts.verifEmail()
automatically logs the user in.
Source: stackoverflow.com
Related Query
- How to make react router work with static assets, html5 mode, history API and nested routes?
- Using React Router with CDN and without webpack or browserify
- React Router V4 protected private route with Redux-persist and React-snapshot
- React Router 4 with optional path AND optional parameter
- How to navigate to another page with a smooth scroll on a specific id with react router and react scroll
- React Router v4 components with similar paths (fixed and dynamic path param) are "overlapping"
- onEnter Transitions with React Router and Redux Simple Router Dont Render New Route's Component
- CSS Code Splitting with Webpack 2 and React Router
- How to nest Scene and navigate with direction='vertical' in React Native Router Flux?
- React Router V4: How to render a modal in the same screen changing only the url and then with that url, be able to rebuild the whole screen
- Sync queryParameters with Redux state and react router for function components
- How to test React Router params with Redux and enzyme
- How to add login authentication and session to ReactJS React Router and Redux with MongoDB + NodeJS Express?
- React Router 4 and exact path with dynamic param
- Testing React Router with Jest and Enzyme
- Meteor's Accounts.onEmailVerificationLink with React and React Router
- React Router v5 accompanied with Code Splitting, and Data Prefetching with the use of Server Side Rendering
- React router v4 with redux protected routes and auth
- React Router v5.2 - Blocking route change with createBrowserHistory and history.block
- React Router with a custom root and a base component
- How to retrieve the parameter after a hash (#) with React Router and useParams hook?
- React with Redux and Router - server rendering
- How to match ambiguous path and static path with React Router
- React Router v6 `useRouter` Hook with `basename` and Redirection
- Dynamically load javascript chunk with webpack and react router
- what is the best way to use react router V6 navigation with redux and redux thunk actions?
- React Router v4 and htaccess with wordpress
- router props and custom props with typescript react router dom for functional components
- React Router difference between component with and without function
- Framer Motion and React router 5: How do I prevent re-render of parent components with nested routes?
More Query from same tag
- Unstated Cannot read property 'setState' of undefined
- React JS - Invariant violation error while using HOC
- React Full calendar Change View API
- Rendering multiple buttons with onClick function in React
- Understanding React refs - why is my reference null here?
- how to open a dialog in material-ui on button click
- Invalid shorthand property initializer with a variable int
- center div cutting into floated left div
- Where to fetchRecords in React - componentDidMount or onComponentDidUpdate or else where?
- Too many re-renders. React limits the number of renders to prevent an infinite loop
- how to set callback of post request in react with redux, redux-thunk and axios?
- short circuit evaluation - React
- Add sentinel layer to leaflet map
- I keep getting this Server Error - Error: The default export is not a React Component in page: "/products/all"
- React JSX class library exports are not working
- Gatsby JS: Preloader is loading forever
- history.push() and Custom URL parameters using react-router
- How to use state variables without sharing among different components inside a loop
- Why I`m getting NaN ? Application seems to work but starting point is NaN. How can I solve this?
- How to Implement this slider in Html/Css and React js?
- Fragment cannot be spread here as objects of type "X" can never be of type "Y"
- eslint: Component Definition is missing displayName
- Tic Tac Toe HTML CSS
- If 'React' is the default export from 'react', Why can't we use some other name instead of 'React'
- React overwriting state variables in an object
- Disable Paste action using Javascript (without include Jquery)
- auth' is not exported from 'firebase' in react app
- Module parse failed: Unexpected token (7:5) You may need an appropriate loader to handle this file type
- How to use scss with css modules / postcss inside components
- React Victory Line Chart For 0-10 minute timeframe