Commit 35a9643b authored by Roger Jungemann's avatar Roger Jungemann
Browse files

Fix active login

parent 1d6ee2b4
......@@ -380,7 +380,7 @@ const mapStateToProps = (state, ownProps) => {
const mapDispatchToProps = dispatch => ({
showLogin: e => {
if (e) e.preventDefault();
dispatch(userActions.showLogin());
dispatch(userActions.showLogin({ type: 'basic' }));
},
logout: e => {
if (e) e.preventDefault();
......
......@@ -70,6 +70,7 @@ export default function reducer(state = defaultState, action) {
}
return state.merge({
show_login_modal: true,
login_type: payload.type,
loginBroadcastOperation: operation,
loginDefault,
});
......
......@@ -140,6 +140,11 @@ function* usernamePasswordLogin2({
operationType /*high security*/,
afterLoginRedirectToWelcome,
}) {
const user = yield select(state => state.user);
const loginType = user.get('login_type');
const justLoggedIn = loginType === 'basic';
console.log('Login type:', loginType, 'Just logged in?', justLoggedIn);
// login, using saved password
let feedURL = false;
let autopost, memoWif, login_owner_pubkey, login_wif_owner_pubkey;
......@@ -352,8 +357,7 @@ function* usernamePasswordLogin2({
);
}
let justLoggedIn = !autopost && saveLogin;
if (justLoggedIn) {
if (!autopost && saveLogin) {
yield put(userActions.saveLogin());
}
......@@ -389,6 +393,7 @@ function* usernamePasswordLogin2({
url.searchParams.set('auth', 'true');
console.log('New post-login URL', url.toString());
window.location.replace(url.toString());
return;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment