legacy/pairent_frontend_react/src/constants.js

38 lines
971 B
JavaScript
Raw Normal View History

2023-05-15 15:21:13 +02:00
import { nanoid } from 'nanoid'
2023-05-05 09:55:40 +02:00
/**
* Api root path
* @type {string}
*/
2023-05-08 15:59:58 +02:00
const API_ROOT = window.location.protocol + '//127.0.0.1:8000';
2023-05-07 01:07:12 +02:00
// ДЛЯ ПРОДА ПОСТАВИТЬ ЭТО: '//pairent.vvsu.ru'
2023-05-05 09:55:40 +02:00
2023-05-15 15:21:13 +02:00
if (window.localStorage.getItem('oidc_client_key') == undefined) {
window.localStorage.setItem('oidc_client_key', nanoid(32));
}
const OIDC_CLIENT_KEY = window.localStorage.getItem('oidc_client_key');
/** OpenID Connect Client Config
* @type {import('oidc-client-ts').OidcClientSettings}
*/
const OIDCConfig = {
onSignIn: () => {},
authority: API_ROOT + '/api/auth/vvsu/',
client_id: 'it-hub-client',
redirect_uri: 'https://pairent.vvsu.ru/sign-in/',
scope: [
'openid',
'vvsu_IdUser',
'vvsu_IdEmpl',
'vvsu_IdStud',
'vvsu_login',
'given_name',
'family_name'
],
client_secret: OIDC_CLIENT_KEY
};
export default Object.freeze({ API_ROOT, OIDCConfig, OIDC_CLIENT_KEY });