mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-03 03:25:24 +03:00
Fixed login issue without pin
This commit is contained in:
parent
682920c5b4
commit
0d674d97af
@ -1,5 +1,6 @@
|
|||||||
import * as dsteem from 'dsteem';
|
import * as dsteem from 'dsteem';
|
||||||
import sha256 from 'crypto-js/sha256';
|
import sha256 from 'crypto-js/sha256';
|
||||||
|
import Config from 'react-native-config';
|
||||||
|
|
||||||
import { getUser } from './dsteem';
|
import { getUser } from './dsteem';
|
||||||
import {
|
import {
|
||||||
@ -21,7 +22,7 @@ import { getSCAccessToken } from '../esteem/esteem';
|
|||||||
// Constants
|
// Constants
|
||||||
import AUTH_TYPE from '../../constants/authType';
|
import AUTH_TYPE from '../../constants/authType';
|
||||||
|
|
||||||
export const login = async (username, password) => {
|
export const login = async (username, password, isPinCodeOpen) => {
|
||||||
let loginFlag = false;
|
let loginFlag = false;
|
||||||
let avatar = '';
|
let avatar = '';
|
||||||
let authType = '';
|
let authType = '';
|
||||||
@ -74,7 +75,17 @@ export const login = async (username, password) => {
|
|||||||
accessToken: '',
|
accessToken: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
account.local = userData;
|
if (isPinCodeOpen) {
|
||||||
|
account.local = userData;
|
||||||
|
} else {
|
||||||
|
const resData = {
|
||||||
|
pinCode: Config.DEFAULT_PIN,
|
||||||
|
password,
|
||||||
|
};
|
||||||
|
const updatedUserData = await getUpdatedUserData(userData, resData);
|
||||||
|
|
||||||
|
account.local = updatedUserData;
|
||||||
|
}
|
||||||
|
|
||||||
const authData = {
|
const authData = {
|
||||||
isLoggedIn: true,
|
isLoggedIn: true,
|
||||||
|
@ -51,7 +51,7 @@ class LoginContainer extends PureComponent {
|
|||||||
|
|
||||||
this.setState({ isLoading: true });
|
this.setState({ isLoading: true });
|
||||||
|
|
||||||
login(username, password)
|
login(username, password, isPinCodeOpen)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
dispatch(updateCurrentAccount({ ...result }));
|
dispatch(updateCurrentAccount({ ...result }));
|
||||||
|
Loading…
Reference in New Issue
Block a user