Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 59s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 59s
This commit is contained in:
commit
ccf012ee1d
2 changed files with 12 additions and 1 deletions
|
|
@ -86,7 +86,7 @@ import { ProfileSalaryHistory } from "../entities/ProfileSalaryHistory";
|
||||||
import { ProfileAssistance } from "../entities/ProfileAssistance";
|
import { ProfileAssistance } from "../entities/ProfileAssistance";
|
||||||
import { CommandRecive } from "../entities/CommandRecive";
|
import { CommandRecive } from "../entities/CommandRecive";
|
||||||
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
import { EmployeePosMaster } from "../entities/EmployeePosMaster";
|
||||||
import { getTopDegrees } from "../services/PositionService";
|
import { CreatePosMasterHistoryOfficer, getTopDegrees } from "../services/PositionService";
|
||||||
import { ProfileLeaveService } from "../services/ProfileLeaveService";
|
import { ProfileLeaveService } from "../services/ProfileLeaveService";
|
||||||
|
|
||||||
@Route("api/v1/org/profile")
|
@Route("api/v1/org/profile")
|
||||||
|
|
@ -10789,6 +10789,9 @@ export class ProfileController extends Controller {
|
||||||
await this.profileRepo.save(profile, { data: request });
|
await this.profileRepo.save(profile, { data: request });
|
||||||
setLogDataDiff(request, { before, after: profile });
|
setLogDataDiff(request, { before, after: profile });
|
||||||
if (requestBody.isLeave == true) {
|
if (requestBody.isLeave == true) {
|
||||||
|
if(orgRevisionRef){
|
||||||
|
await CreatePosMasterHistoryOfficer(orgRevisionRef.id, request);
|
||||||
|
}
|
||||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||||
}
|
}
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,14 @@ export async function expressAuthentication(
|
||||||
securityName: string,
|
securityName: string,
|
||||||
_scopes?: string[],
|
_scopes?: string[],
|
||||||
) {
|
) {
|
||||||
|
// API_KEY bypass logic (support api_key, x-api-key, apikey)
|
||||||
|
const apiKeyHeader =
|
||||||
|
request.headers["api-key"] || request.headers["x-api-key"] || request.headers["apikey"];
|
||||||
|
if (apiKeyHeader !== undefined) {
|
||||||
|
if (apiKeyHeader === process.env.API_KEY) {
|
||||||
|
return { preferred_username: "api_key_bypass", apiKeyBypass: true };
|
||||||
|
}
|
||||||
|
}
|
||||||
if (process.env.NODE_ENV !== "production" && process.env.AUTH_BYPASS) {
|
if (process.env.NODE_ENV !== "production" && process.env.AUTH_BYPASS) {
|
||||||
return { preferred_username: "bypassed" };
|
return { preferred_username: "bypassed" };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue