Browse Source

Remove magic number

pull/342/head
Guillaume Vincent 6 years ago
parent
commit
910ac87825
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/store/actions.js

+ 3
- 1
src/store/actions.js View File

@@ -2,6 +2,7 @@ import Password from "../api/password";
import User from "../api/user"; import User from "../api/user";
import * as urlParser from "../services/url-parser"; import * as urlParser from "../services/url-parser";
import * as types from "./mutation-types"; import * as types from "./mutation-types";
import defaultPasswordProfile from "./defaultPassword";


export const refreshToken = ({ commit, state }) => { export const refreshToken = ({ commit, state }) => {
const token = state.token; const token = state.token;
@@ -22,7 +23,8 @@ export const loadPasswordProfile = ({ commit }, { site }) => {


export const getPasswordFromUrlQuery = ({ commit }, { query }) => { export const getPasswordFromUrlQuery = ({ commit }, { query }) => {
const password = urlParser.getPasswordFromUrlQuery(query); const password = urlParser.getPasswordFromUrlQuery(query);
if (Object.keys(password).length === 9) {
const expectedNbOfElements = Object.keys(defaultPasswordProfile).length;
if (Object.keys(password).length === expectedNbOfElements) {
commit(types.SET_PASSWORD, { password }); commit(types.SET_PASSWORD, { password });
} }
}; };


Loading…
Cancel
Save