Add & update env variables

This commit is contained in:
Sadrinho27 2025-09-12 11:04:26 +02:00
parent 08ec129196
commit 55c30134ff
5 changed files with 22 additions and 29 deletions

View File

@ -22,6 +22,7 @@ const nextConfig = {
NEXT_PUBLIC_HOTJAR_VERSION: process.env.NEXT_PUBLIC_HOTJAR_VERSION,
NEXT_PUBLIC_4NK_URL: process.env.NEXT_PUBLIC_4NK_URL,
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
NEXT_PUBLICK_ANK_BASE_REDIRECT_URI: process.env.NEXT_PUBLIC_ANK_BASE_REDIRECT_URI,
NEXT_PUBLIC_DEFAULT_VALIDATOR_ID: process.env.NEXT_PUBLIC_DEFAULT_VALIDATOR_ID,
NEXT_PUBLIC_DEFAULT_STORAGE_URLS: process.env.NEXT_PUBLIC_DEFAULT_STORAGE_URLS,
},
@ -42,6 +43,7 @@ const nextConfig = {
NEXT_PUBLIC_HOTJAR_VERSION: process.env.NEXT_PUBLIC_HOTJAR_VERSION,
NEXT_PUBLIC_4NK_URL: process.env.NEXT_PUBLIC_4NK_URL,
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
NEXT_PUBLICK_ANK_BASE_REDIRECT_URI: process.env.NEXT_PUBLIC_ANK_BASE_REDIRECT_URI,
NEXT_PUBLIC_DEFAULT_VALIDATOR_ID: process.env.NEXT_PUBLIC_DEFAULT_VALIDATOR_ID,
NEXT_PUBLIC_DEFAULT_STORAGE_URLS: process.env.NEXT_PUBLIC_DEFAULT_STORAGE_URLS,
},
@ -62,6 +64,7 @@ const nextConfig = {
NEXT_PUBLIC_HOTJAR_VERSION: process.env.NEXT_PUBLIC_HOTJAR_VERSION,
NEXT_PUBLIC_4NK_URL: process.env.NEXT_PUBLIC_4NK_URL,
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL,
NEXT_PUBLICK_ANK_BASE_REDIRECT_URI: process.env.NEXT_PUBLIC_ANK_BASE_REDIRECT_URI,
NEXT_PUBLIC_DEFAULT_VALIDATOR_ID: process.env.NEXT_PUBLIC_DEFAULT_VALIDATOR_ID,
NEXT_PUBLIC_DEFAULT_STORAGE_URLS: process.env.NEXT_PUBLIC_DEFAULT_STORAGE_URLS,
},

View File

@ -41,12 +41,8 @@ export default class Auth extends BaseApiService {
}
public async idNotAuth(autorizationCode: string | string[]): Promise<{ idNotUser: any; authToken: string }> {
// const variables = FrontendVariables.getInstance();
// TODO: review
const baseBackUrl = 'http://localhost:8080';//variables.BACK_API_PROTOCOL + variables.BACK_API_HOST;
const url = new URL(`${baseBackUrl}/api/v1/idnot/auth/${autorizationCode}`);
const variables = FrontendVariables.getInstance();
const url = new URL(`${variables.BACK_API_PROTOCOL}://${variables.BACK_API_HOST}:${variables.BACK_API_PORT}/api/v1/idnot/auth/${autorizationCode}`);
try {
return await this.postRequest<{ idNotUser: any; authToken: string }>(url);
} catch (err) {
@ -56,9 +52,8 @@ export default class Auth extends BaseApiService {
}
public async getIdNotUser(): Promise<{ success: boolean; data: any }> {
const baseBackUrl = 'http://localhost:8080';//variables.BACK_API_PROTOCOL + variables.BACK_API_HOST;
const url = new URL(`${baseBackUrl}/api/v1/idnot/user`);
const variables = FrontendVariables.getInstance();
const url = new URL(`${variables.BACK_API_PROTOCOL}://${variables.BACK_API_HOST}:${variables.BACK_API_PORT}/api/v1/idnot/user`);
try {
return await this.getRequest(url);
}
@ -69,9 +64,8 @@ export default class Auth extends BaseApiService {
}
public async getIdNotOfficeForUser(userId: string): Promise<any[]> {
const baseBackUrl = 'http://localhost:8080';//variables.BACK_API_PROTOCOL + variables.BACK_API_HOST;
const url = new URL(`${baseBackUrl}/api/v1/idnot/user/rattachements`);
const variables = FrontendVariables.getInstance();
const url = new URL(`${variables.BACK_API_PROTOCOL}://${variables.BACK_API_HOST}:${variables.BACK_API_PORT}/api/v1/idnot/user/rattachements`);
url.searchParams.set('idNot', userId);
try {
return await this.getRequest(url);
@ -83,9 +77,8 @@ export default class Auth extends BaseApiService {
}
public async getIdNotUserForOffice(officeId: string): Promise<any[]> {
const baseBackUrl = 'http://localhost:8080';//variables.BACK_API_PROTOCOL + variables.BACK_API_HOST;
const url = new URL(`${baseBackUrl}/api/v1/idnot/office/rattachements`);
const variables = FrontendVariables.getInstance();
const url = new URL(`${variables.BACK_API_PROTOCOL}://${variables.BACK_API_HOST}:${variables.BACK_API_PORT}/api/v1/idnot/office/rattachements`);
url.searchParams.set('idNot', officeId);
try {
return await this.getRequest(url);
@ -96,9 +89,8 @@ export default class Auth extends BaseApiService {
}
public async getUserProcessByIdNot(pairingId: string): Promise<{ success: boolean; data: { processId: string, processData: { [key: string]: any } } }> {
const baseBackUrl = 'http://localhost:8080';//variables.BACK_API_PROTOCOL + variables.BACK_API_HOST;
const url = new URL(`${baseBackUrl}/api/v1/process/user`);
const variables = FrontendVariables.getInstance();
const url = new URL(`${variables.BACK_API_PROTOCOL}://${variables.BACK_API_HOST}:${variables.BACK_API_PORT}/api/v1/process/user`);
url.searchParams.set('pairingId', pairingId);
try {
return await this.getRequest(url);
@ -109,9 +101,8 @@ export default class Auth extends BaseApiService {
}
public async getOfficeProcessByIdNot(): Promise<{ success: boolean; data: { processId: string, processData: { [key: string]: any } } }> {
const baseBackUrl = 'http://localhost:8080';//variables.BACK_API_PROTOCOL + variables.BACK_API_HOST;
const url = new URL(`${baseBackUrl}/api/v1/process/office`);
const variables = FrontendVariables.getInstance();
const url = new URL(`${variables.BACK_API_PROTOCOL}://${variables.BACK_API_HOST}:${variables.BACK_API_PORT}/api/v1/process/office`);
try {
return await this.getRequest(url);
} catch (err) {

View File

@ -89,10 +89,7 @@ export default class Customers extends BaseNotary {
}
public async sendReminder(office: any, customer: any): Promise<void> {
// TODO: review
const baseBackUrl = 'http://localhost:8080';//variables.BACK_API_PROTOCOL + variables.BACK_API_HOST;
const url = new URL(`${baseBackUrl}/api/send_reminder`);
const url = new URL(`${this.variables.BACK_API_PROTOCOL}://${this.variables.BACK_API_HOST}:${this.variables.BACK_API_PORT}/api/send_reminder`);
//const url = new URL(this.baseURl.concat(`/${uid}/send_reminder`));
try {

View File

@ -41,18 +41,18 @@ export default function StepEmail(props: IProps) {
const router = useRouter();
const error = router.query["error"];
const variables = FrontendVariables.getInstance();
const redirectUserOnConnection = useCallback(() => {
/* TODO: review
const variables = FrontendVariables.getInstance();
router.push(
`${variables.IDNOT_BASE_URL + variables.IDNOT_AUTHORIZE_ENDPOINT}?client_id=${variables.IDNOT_CLIENT_ID}&redirect_uri=${
variables.FRONT_APP_HOST
}/authorized-client&scope=openid,profile&response_type=code`,
);
*/
const redirectUri = 'http://local.4nkweb.com:3000/authorized-client';
router.push(
`https://qual-connexion.idnot.fr/user/IdPOAuth2/authorize/idnot_idp_v1?client_id=B3CE56353EDB15A9&redirect_uri=${redirectUri}&scope=openid,profile&response_type=code`,
`${variables.IDNOT_BASE_URL}/user/${variables.IDNOT_AUTHORIZE_ENDPOINT}?client_id=${variables.IDNOT_CLIENT_ID}&redirect_uri=${variables.ANK_BASE_REDIRECT_URI}&scope=openid,profile&response_type=code`,
);
}, [router]);
@ -66,7 +66,7 @@ export default function StepEmail(props: IProps) {
const closeNoEmailModal = useCallback(() => {
setIsErrorModalOpen(0);
router.push("https://connexion.idnot.fr/");
router.push(variables.IDNOT_BASE_URL);
}, [router]);
// const closeContactAdminModal = () => {

View File

@ -35,6 +35,8 @@ export class FrontendVariables {
public API_URL!: string;
public ANK_BASE_REDIRECT_URI!: string;
private constructor() {}
public static getInstance(): FrontendVariables {