Skip to content

Commit 5f45fcc

Browse files
author
Etienne Tremel
committed
Fix usage of onEnter function
1 parent 713c2b0 commit 5f45fcc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/auth-flow/app.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ var Logout = React.createClass({
113113
}
114114
});
115115

116-
function requireAuth(nextState, redirectTo) {
117-
if (!auth.loggedIn())
118-
redirectTo('/login', null, { nextPathname: nextState.location.pathname });
116+
function requireAuth(nextState, replaceState) {
117+
if (!auth.loggedIn()) {
118+
replaceState(null, '/login');
119+
}
119120
}
120121

121122
React.render((

0 commit comments

Comments
 (0)