mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-24 00:31:30 +00:00
Local login now working great
This commit is contained in:
@@ -35,11 +35,6 @@ const Homebrew = React.createClass({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
console.log('user', this.props.user);
|
|
||||||
console.log('loginpath', this.props.loginPath);
|
|
||||||
|
|
||||||
//console.log(mapObject(['version', 'brew', 'account'], this.props));
|
|
||||||
|
|
||||||
BrewActions.init({
|
BrewActions.init({
|
||||||
version : this.props.version,
|
version : this.props.version,
|
||||||
brew : this.props.brew
|
brew : this.props.brew
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ const Actions = {
|
|||||||
Store.init(initState);
|
Store.init(initState);
|
||||||
},
|
},
|
||||||
login : ()=>{
|
login : ()=>{
|
||||||
console.log('login');
|
window.location = Store.getLoginPath();
|
||||||
//redirect to the login path and add the redirect
|
|
||||||
|
|
||||||
},
|
},
|
||||||
logout : ()=>{
|
logout : ()=>{
|
||||||
document.cookie = 'nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;domain=.naturalcrit.com';
|
document.cookie = 'nc_session=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/;domain=.naturalcrit.com';
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ Store.getLoginPath = ()=>{
|
|||||||
let path = State.loginPath;
|
let path = State.loginPath;
|
||||||
if(typeof window !== 'undefined'){
|
if(typeof window !== 'undefined'){
|
||||||
console.log('yo here');
|
console.log('yo here');
|
||||||
|
path = `${path}?redirect=${encodeURIComponent(window.location.href)}`;
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user