UNPKG

react-saasify-chrisvxd

Version:

React components for Saasify web clients.

21 lines (17 loc) 435 B
import React from 'react' import { Redirect } from 'react-router-dom' export function handleAuth({ auth, location }) { if (auth.isAuthenticated) { const params = new URLSearchParams(location.search) const plan = params.get('plan') if (plan === 'unlimited') { return ( <Redirect to={`/checkout?plan=${plan}`} /> ) } else { return ( <Redirect to='/dashboard' /> ) } } }