|
1 | 1 | import React, { findDOMNode } from 'react';
|
2 |
| -import HashHistory from 'react-router/lib/HashHistory'; |
| 2 | +import { HashHistory } from 'react-router/lib/HashHistory'; |
3 | 3 | import { Router, Route, Link, Navigation } from 'react-router';
|
4 | 4 | import auth from './auth';
|
5 | 5 |
|
@@ -76,8 +76,8 @@ var Login = React.createClass({
|
76 | 76 |
|
77 | 77 | var { location } = this.props;
|
78 | 78 |
|
79 |
| - if (location.query && location.query.nextPathname) { |
80 |
| - this.replaceWith(location.query.nextPathname); |
| 79 | + if (location.query && location.state.nextPathname) { |
| 80 | + this.replaceWith(location.state.nextPathname); |
81 | 81 | } else {
|
82 | 82 | this.replaceWith('/about');
|
83 | 83 | }
|
@@ -116,11 +116,11 @@ var Logout = React.createClass({
|
116 | 116 |
|
117 | 117 | function requireAuth(nextState, transition) {
|
118 | 118 | if (!auth.loggedIn())
|
119 |
| - transition.to('/login', { nextPathname: nextState.location.pathname }); |
| 119 | + transition.to('/login', null, { nextPathname: nextState.location.pathname }); |
120 | 120 | }
|
121 | 121 |
|
122 | 122 | React.render((
|
123 |
| - <Router history={HashHistory}> |
| 123 | + <Router history={new HashHistory({ queryKey: true })}> |
124 | 124 | <Route path="/" component={App}>
|
125 | 125 | <Route path="login" component={Login}/>
|
126 | 126 | <Route path="logout" component={Logout}/>
|
|
0 commit comments