-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
59 lines (50 loc) · 1.59 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import React from 'react';
import ReactDOM from 'react-dom';
import injectTapEventPlugin from 'react-tap-event-plugin';
import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';
import { BrowserRouter } from 'react-router-dom';
import store from "./store.js"
import $ from 'jquery'
import { Provider } from 'react-redux'
var Auth = require('j-toker');
let backendHost;
const hostname = window && window.location && window.location.hostname;
if(hostname === 'security.seon.network') {
backendHost = 'https://api.seon.network';
} else if(hostname === 'security.staging.seon.network') {
backendHost = 'https://api.staging.seon.network';
} else {
backendHost = 'http://127.0.0.1:3000';
}
const apiVersion = 'v1';
const API_ROOT = `${backendHost}/api/${apiVersion}`;
Auth.configure({
apiUrl: API_ROOT,
signOutPath: '/company/sign_out',
emailSignInPath: '/company/sign_in',
emailRegistrationPath: '/company',
accountUpdatePath: '/company',
accountDeletePath: '/company',
passwordResetPath: '/company/password',
passwordUpdatePath: '/company/password',
tokenValidationPath: '/company/validate_token',
confirmationSuccessUrl: function() {
return `${process.env.REACT_APP_URL}/confirm`;
}
});
$.ajaxSetup({
beforeSend: function(xhr, settings) {
Auth.appendAuthHeaders(xhr, settings);
}
});
injectTapEventPlugin();
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<App store={store}/>
</BrowserRouter>
</Provider>, document.getElementById('root')
);
registerServiceWorker();