import { nanoid } from 'nanoid'

/** @returns {string} */
const api_path = path => API_ROOT + path;

/**
 * Api root path 
 * @type {string}
 */
const API_ROOT = window.location.protocol + '//' + window.location.host;
// ДЛЯ ПРОДА ПОСТАВИТЬ ЭТО: '//' + window.location.host

/** OpenID Connect Client Config
 * @type {import('oidc-client-ts').OidcClientSettings}
 */
const OIDCConfig = {
    authority: api_path('/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'
};

export default Object.freeze({ API_ROOT, OIDCConfig, api_path });