Explorar el Código

Remove magic number

pull/342/head
Guillaume Vincent hace 6 años
padre
commit
910ac87825
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. +3
    -1
      src/store/actions.js

+ 3
- 1
src/store/actions.js Ver fichero

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

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

export const getPasswordFromUrlQuery = ({ commit }, { 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 });
}
};


Cargando…
Cancelar
Guardar