1 | export const routeList = {
|
2 | search: '/search',
|
3 | signup: '/signup',
|
4 | login: '/login',
|
5 | stores: '/stores',
|
6 | store: '/store',
|
7 | tree: '/tree',
|
8 | myPages: '/my-pages',
|
9 | forgotPassword: '/forgot-password',
|
10 | resetPassword: '/reset-password'
|
11 | };
|
12 |
|
13 | export function addMissingConfig(userConfig) {
|
14 | if (!userConfig.pathsWithNoAuthRequired) {
|
15 | userConfig.pathsWithNoAuthRequired = [
|
16 | '/login',
|
17 | '/reset-password',
|
18 | '/forgot-password'
|
19 | ];
|
20 | }
|
21 | if (!userConfig.loginPath) {
|
22 | userConfig.loginPath = '/login';
|
23 | }
|
24 | if (!userConfig.routes)
|
25 | userConfig.routes = {};
|
26 | Object.keys(routeList).forEach(key => {
|
27 | if (!userConfig.routes.hasOwnProperty(key))
|
28 | userConfig.routes[key] = { path: routeList[key] };
|
29 | });
|
30 | return userConfig;
|
31 | }
|
32 |
|
\ | No newline at end of file |