Add Disable Authentication option in the frontend

This commit is contained in:
ShahanaFarooqui 2026-03-25 20:27:52 -07:00
parent bea43f211c
commit b9fa4b2998
No known key found for this signature in database
GPG key ID: 951B8D133DD4AF6E
7 changed files with 9 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -103,7 +103,9 @@ export class AppComponent implements OnInit, AfterViewInit, OnDestroy {
subscribe((action: (any)) => {
if (action.type === RTLActions.SET_APPLICATION_SETTINGS) {
if (!this.sessionService.getItem('token')) {
if (+action.payload.SSO.rtlSSO) {
if (!!action.payload.disableAuth) {
this.store.dispatch(login({ payload: { password: 'disabledAuth', defaultPassword: false } }));
} else if (+action.payload.SSO.rtlSSO) {
if (!this.accessKey || this.accessKey.trim().length < 32) {
this.router.navigate(['./error'], { state: { errorCode: '406', errorMessage: 'Access key too short. It should be at least 32 characters long.' } });
} else {

View file

@ -51,6 +51,7 @@ export class RTLConfiguration {
public SSO: SSO,
public enable2FA: boolean,
public secret2FA: string,
public disableAuth: boolean,
public allowPasswordUpdate: boolean,
public nodes: Node[]
) { }

View file

@ -138,6 +138,7 @@ export enum AlertTypeEnum {
}
export enum AuthenticateWith {
NOAUTH = 'NOAUTH',
JWT = 'JWT',
PASSWORD = 'PASSWORD'
}

View file

@ -368,7 +368,7 @@ export class RTLEffects implements OnDestroy {
this.store.dispatch(resetECLStore());
this.store.dispatch(updateRootAPICallStatus({ payload: { action: 'Login', status: APICallStatusEnum.INITIATED } }));
return this.httpClient.post(API_END_POINTS.AUTHENTICATE_API, {
authenticateWith: (!action.payload.password) ? AuthenticateWith.JWT : AuthenticateWith.PASSWORD,
authenticateWith: (action.payload.password === 'disabledAuth') ? AuthenticateWith.NOAUTH : (!action.payload.password) ? AuthenticateWith.JWT : AuthenticateWith.PASSWORD,
authenticationValue: (!action.payload.password) ? (this.sessionService.getItem('token') ? this.sessionService.getItem('token') : '') : action.payload.password,
twoFAToken: (action.payload.twoFAToken) ? action.payload.twoFAToken : ''
}).pipe(

View file

@ -30,6 +30,7 @@ export const initRootState: RootState = {
SSO: { rtlSSO: 0, logoutRedirectLink: '' },
enable2FA: false,
secret2FA: '',
disableAuth: false,
allowPasswordUpdate: true,
nodes: [{ settings: initNodeSettings, authentication: initNodeAuthentication }]
},