Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "PWA-3273:Get Minimum Password Length from configuration" #4324

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions packages/peregrine/lib/store/actions/user/asyncActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,13 @@ export const resetPassword = ({ email }) =>
dispatch(actions.resetPassword.receive());
};

export const setToken = (token, customerAccessTokenLifetime = 1) =>
export const setToken = (token, customer_token_lifetime = 3600) =>
async function thunk(...args) {
const [dispatch] = args;

// Store token in local storage.
// TODO: Get correct token expire time from API
storage.setItem(
'signin_token',
token,
customerAccessTokenLifetime * 3600
);
storage.setItem('signin_token', token, customer_token_lifetime);

// Persist in store
dispatch(actions.setToken(token));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`errros should render properly 1`] = `
Map {
"createAccountQuery" => "Create Account Mutation Error",
"signInMutation" => "Sign In Mutation Error",
}
`;

exports[`handle submit event creates an account, dispatches event, signs in, and generates a new cart 1`] = `
Object {
"payload": Object {
Expand All @@ -19,30 +12,6 @@ Object {
}
`;

exports[`handle submit event should dispatch create account event 1`] = `
Object {
"payload": Object {
"email": "bender@planet.express",
"firstName": "Bender",
"isSubscribed": false,
"lastName": "Rodriguez",
},
"type": "USER_CREATE_ACCOUNT",
}
`;

exports[`handleSubmit should dispatch create account event 1`] = `
Object {
"payload": Object {
"email": "bender@planet.express",
"firstName": "Bender",
"isSubscribed": false,
"lastName": "Rodriguez",
},
"type": "USER_CREATE_ACCOUNT",
}
`;

exports[`returns the correct shape 1`] = `
Object {
"errors": Map {
Expand All @@ -60,7 +29,6 @@ Object {
},
"isDisabled": false,
"recaptchaWidgetProps": Object {},
"minimumPasswordLength":8
}
`;

Expand All @@ -81,28 +49,5 @@ Object {
},
"isDisabled": false,
"recaptchaWidgetProps": Object {},
minimumPasswordLength:8
}
`;

exports[`should return properly 1`] = `
Object {
"errors": Map {
"createAccountQuery" => null,
"signInMutation" => null,
},
"handleEnterKeyPress": [Function],
"handleSubmit": [Function],
"initialValues": Object {
"customer": Object {
"email": "gooston@goosemail.com",
"firstname": "Gooseton",
"lastname": "Jr",
},
"userName": "gooseton",
},
"isDisabled": false,
"minimumPasswordLength": 8,
"recaptchaWidgetProps": Object {},
}
`;
Loading
Loading