Skip to content

Commit

Permalink
Merge branch 'fix/login-redirection' into 'development-rebl'
Browse files Browse the repository at this point in the history
Fix login redirection

See merge request ibriz-internal/blockstack-notes-sample!11
  • Loading branch information
gaurab13 committed Jan 31, 2020
2 parents 52e9b1c + ed30577 commit 9b478e7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/AppRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import Content from './Content';
import ExtLanding from './ExtLanding';
import { useBlockstack } from 'react-blockstack';
import Login from './Login';
import { UserSession } from 'blockstack';
import Loader from './Loader';

export default function AppRouter() {
const { person, signOut } = useBlockstack();
return (
const isSigninPending = new UserSession().isSignInPending();
return isSigninPending ? <Loader/> : (
<Switch>
<Route
exact={true}
Expand Down Expand Up @@ -39,8 +42,8 @@ export default function AppRouter() {
render={routeProps => {
if (person) {
return <Content {...routeProps} person={person} />;
} else if (person === null) {
window.location.assign('https://vaultilo.madoveradvertising.com/');
} else {
window.location.assign('https://vaultilo.com');
}
}}
/>
Expand Down

0 comments on commit 9b478e7

Please sign in to comment.