Skip to content

Commit

Permalink
use config.json instead of .env
Browse files Browse the repository at this point in the history
  • Loading branch information
TuuKeZu committed Aug 16, 2024
1 parent 4990167 commit fd1cd3d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
"workbox-webpack-plugin": "^6.4.1"
},
"scripts": {
"start": "node --env-file=.env scripts/start.js",
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node --env-file=.env scripts/test.js"
"test": "node scripts/test.js"
},
"eslintConfig": {
"extends": "react-app"
Expand Down
4 changes: 2 additions & 2 deletions src/compontents/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { useNavigate } from 'react-router-dom';
import { BlurLayer } from '../LoadingScreen/LoadingScreen';
import { useVersion } from '../../features/version/versionSlice';

const { REACT_APP_VERSION_LABEL } = process.env;
const versionLabel = REACT_APP_VERSION_LABEL;
import config from '../../config.json';
const { versionLabel } = config;


export default function Login() {
Expand Down
6 changes: 2 additions & 4 deletions src/features/authentication/authSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
import { handleError } from '../errors/errorSlice';
import crypto from 'crypto-js';

const { REACT_APP_SIGNATURE } = process.env;
const signature = REACT_APP_SIGNATURE;
import config from '../../config.json';
const { signature } = config;

export const loginToWilma = createAsyncThunk(
'auth/loginToWilma',
Expand Down Expand Up @@ -84,8 +84,6 @@ export const getSavedCredentials = () => {
}

if (encrypted === "null") return null;

console.log(encrypted);

const decrypted = crypto.AES.decrypt(encrypted, signature).toString(crypto.enc.Utf8);
try {
Expand Down
1 change: 0 additions & 1 deletion src/features/themes/themeSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const loadThemeDefault = createAsyncThunk(
'themes/loadThemeDefault',
async (options, thunkAPI) => {
return await new Promise((resolve, reject) => {
console.log(process.env);
const themes = thunkAPI.getState().themes;
const id = options['id'];

Expand Down
5 changes: 2 additions & 3 deletions src/requests/theme-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import {
cacheAvailable
} from './utility'

const { REACT_APP_OTAWILMA_API } = process.env;
const otaWilmaApi = REACT_APP_OTAWILMA_API;

import config from '../config.json';
const { otaWilmaApi } = config;

const login = (auth) => {
return new Promise(async (resolve, reject) => {
Expand Down
4 changes: 2 additions & 2 deletions src/requests/wilma-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {

import { login as loginToOtaWilma } from './theme-api'

const { REACT_APP_WILMA_API } = process.env;
const wilmaApi = REACT_APP_WILMA_API;
import config from '../config.json';
const { wilmaApi } = config;

const login = (credentials) => {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit fd1cd3d

Please sign in to comment.