@sabstravtech/obtservices 0.2.2601130820 → 0.2.2602191600
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/lib/vendor/models/login.model.d.ts +13 -1
- package/base/lib/vendor/services/logon.service.d.ts +9 -1
- package/base/lib/vendor/services/url.service.d.ts +2 -0
- package/fesm2022/sabstravtech-obtservices-base.mjs +111 -64
- package/fesm2022/sabstravtech-obtservices-base.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,8 @@ export declare enum LoginErrorReason {
|
|
|
10
10
|
PASSWORD_CHANGE = 1,
|
|
11
11
|
LOGED_IN = 2,
|
|
12
12
|
AUTH_ERROR = 3,
|
|
13
|
-
SSO = 4
|
|
13
|
+
SSO = 4,
|
|
14
|
+
MFA_REQUIRED = 5
|
|
14
15
|
}
|
|
15
16
|
export interface PasswordChangeResponse {
|
|
16
17
|
alreadyLoggedIn: boolean;
|
|
@@ -34,6 +35,17 @@ export interface LoginResponse {
|
|
|
34
35
|
loginSuccess: boolean;
|
|
35
36
|
message: string;
|
|
36
37
|
passwordDescription: string;
|
|
38
|
+
mfa_access_only?: boolean;
|
|
39
|
+
mfa_expires_after_epoch_ms?: number;
|
|
40
|
+
user_id?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface MfaLoginRequest {
|
|
43
|
+
userId: number;
|
|
44
|
+
mfaCode: string;
|
|
45
|
+
}
|
|
46
|
+
export interface MfaReissueResponse {
|
|
47
|
+
message?: string;
|
|
48
|
+
existingTokenTtl?: number;
|
|
37
49
|
}
|
|
38
50
|
export interface LoginErrorData {
|
|
39
51
|
message: string;
|
|
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs';
|
|
|
4
4
|
import { BaseEventMessenager } from '../classes/event-messenager';
|
|
5
5
|
import { BaseEnvironment } from '../classes/enviroment';
|
|
6
6
|
import { UserData } from '../interfaces/user.data';
|
|
7
|
-
import { AuthInfo, LoginResponse, PasswordChangeResponse } from '../models/login.model';
|
|
7
|
+
import { AuthInfo, LoginResponse, MfaReissueResponse, PasswordChangeResponse } from '../models/login.model';
|
|
8
8
|
import { UserServiceInterface } from '../interfaces/Iuser.service';
|
|
9
9
|
import { AbstractHttpCallService } from './http-call.service';
|
|
10
10
|
import { Router } from '../types/types';
|
|
@@ -48,6 +48,14 @@ export declare class BaseLogonService<GLV_F extends GetLatestVersionsFetcherType
|
|
|
48
48
|
endBecomeUserSession(): Promise<boolean>;
|
|
49
49
|
login(username: string, password: string, again?: boolean): Observable<UserData>;
|
|
50
50
|
handleResponse(data: any): any;
|
|
51
|
+
/**
|
|
52
|
+
* Submit MFA code for verification
|
|
53
|
+
*/
|
|
54
|
+
submitMfaCode(userId: number, mfaCode: string): Observable<UserData>;
|
|
55
|
+
/**
|
|
56
|
+
* Request a new MFA code to be sent via email
|
|
57
|
+
*/
|
|
58
|
+
resendMfaCode(): Observable<MfaReissueResponse>;
|
|
51
59
|
logout(): void;
|
|
52
60
|
clearLoginData(): void;
|
|
53
61
|
resetPassword(passwordResetToken: string, newPassword: string, source: string): Observable<PasswordChangeResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BehaviorSubject, of, combineLatest, Subject, forkJoin, Subscription } from 'rxjs';
|
|
2
|
-
import { take, map as map$1, catchError, debounceTime, distinctUntilChanged, switchMap, tap, takeUntil, filter, finalize } from 'rxjs/operators';
|
|
2
|
+
import { take, map as map$1, catchError, debounceTime, distinctUntilChanged, switchMap, tap, takeUntil, filter, finalize, timeout } from 'rxjs/operators';
|
|
3
3
|
import moment from 'moment';
|
|
4
4
|
import { __decorate } from 'tslib';
|
|
5
5
|
import _, { uniq } from 'lodash';
|
|
@@ -13750,14 +13750,12 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
13750
13750
|
? this.helpers.makeTimeWindow(dateTime, -timeFlexibility, timeFlexibility)
|
|
13751
13751
|
: null;
|
|
13752
13752
|
}
|
|
13753
|
-
makeArrivalTimeWindow(dateTime, window
|
|
13753
|
+
makeArrivalTimeWindow(dateTime, window) {
|
|
13754
13754
|
if (window !== TimeWindow.Arrive) {
|
|
13755
13755
|
return null;
|
|
13756
13756
|
}
|
|
13757
|
-
|
|
13758
|
-
|
|
13759
|
-
: this.tempParams.inTimeFlexibility;
|
|
13760
|
-
return this.helpers.makeTimeWindow(dateTime, -timeFlexibility, 0);
|
|
13757
|
+
// Arrive By always uses a fixed 2-hour window before the arrival time
|
|
13758
|
+
return this.helpers.makeTimeWindow(dateTime, -2, 0);
|
|
13761
13759
|
}
|
|
13762
13760
|
convertRecentSearchDateTime(date, timeWindow, hours = 2) {
|
|
13763
13761
|
if (timeWindow) {
|
|
@@ -13798,7 +13796,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
13798
13796
|
outboundDepartureTimeWindow: timeWindow
|
|
13799
13797
|
? timeWindow.outboundTimeWindow.replace(/%3A/g, '')
|
|
13800
13798
|
: this.makeDepartureTimeWindow(this.tempParams.outBoundDate, this.tempParams.outTimeCriteria, FlightSearchType.oneWay),
|
|
13801
|
-
outboundArrivalTimeWindow: this.makeArrivalTimeWindow(this.tempParams.outBoundDate, this.tempParams.outTimeCriteria
|
|
13799
|
+
outboundArrivalTimeWindow: this.makeArrivalTimeWindow(this.tempParams.outBoundDate, this.tempParams.outTimeCriteria)
|
|
13802
13800
|
}, {
|
|
13803
13801
|
passengers: this._passengers,
|
|
13804
13802
|
returnTrip: this.isReturn,
|
|
@@ -13816,7 +13814,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
|
|
|
13816
13814
|
returnDepartureTimeWindow: timeWindow
|
|
13817
13815
|
? timeWindow.returnTimeWindow.replace(/%3A/g, '')
|
|
13818
13816
|
: this.makeDepartureTimeWindow(this.tempParams.inboundDate, this.tempParams.inTimeCriteria, FlightSearchType.return),
|
|
13819
|
-
returnArrivalTimeWindow: this.makeArrivalTimeWindow(this.tempParams.inboundDate, this.tempParams.inTimeCriteria
|
|
13817
|
+
returnArrivalTimeWindow: this.makeArrivalTimeWindow(this.tempParams.inboundDate, this.tempParams.inTimeCriteria),
|
|
13820
13818
|
returnCabinClass: this.tempParams.returnCabinClass
|
|
13821
13819
|
? [this.tempParams.returnCabinClass]
|
|
13822
13820
|
: null
|
|
@@ -29129,6 +29127,12 @@ class SupplementaryBookingInfoImpl {
|
|
|
29129
29127
|
delete userValue.supplementaryInfo.t_loyaltyCode;
|
|
29130
29128
|
}
|
|
29131
29129
|
}
|
|
29130
|
+
if (userValue.supplementaryInfo.meal === '') {
|
|
29131
|
+
userValue.supplementaryInfo.meal = 'None';
|
|
29132
|
+
}
|
|
29133
|
+
if (userValue.supplementaryInfo.specialNeeds === '') {
|
|
29134
|
+
userValue.supplementaryInfo.specialNeeds = 'None';
|
|
29135
|
+
}
|
|
29132
29136
|
if (userValue.supplementaryInfo.dob) {
|
|
29133
29137
|
userValue.supplementaryInfo.dob = this.helpers
|
|
29134
29138
|
.ngDateToMoment(userValue.supplementaryInfo.dob)
|
|
@@ -29201,6 +29205,12 @@ class SupplementaryBookingInfoImpl {
|
|
|
29201
29205
|
delete userValue.supplementaryInfo.t_loyaltyCode;
|
|
29202
29206
|
}
|
|
29203
29207
|
}
|
|
29208
|
+
if (userValue.supplementaryInfo.meal === '') {
|
|
29209
|
+
userValue.supplementaryInfo.meal = 'None';
|
|
29210
|
+
}
|
|
29211
|
+
if (userValue.supplementaryInfo.specialNeeds === '') {
|
|
29212
|
+
userValue.supplementaryInfo.specialNeeds = 'None';
|
|
29213
|
+
}
|
|
29204
29214
|
if (userValue.supplementaryInfo.passport) {
|
|
29205
29215
|
if (userValue.supplementaryInfo.passport.dateOfExpiry?.year) {
|
|
29206
29216
|
userValue.supplementaryInfo.passport.dateOfExpiry = this.helpers.formatIsoDate(this.helpers.ngDateToMoment(userValue.supplementaryInfo.passport.dateOfExpiry));
|
|
@@ -30649,6 +30659,7 @@ var LoginErrorReason;
|
|
|
30649
30659
|
LoginErrorReason[LoginErrorReason["LOGED_IN"] = 2] = "LOGED_IN";
|
|
30650
30660
|
LoginErrorReason[LoginErrorReason["AUTH_ERROR"] = 3] = "AUTH_ERROR";
|
|
30651
30661
|
LoginErrorReason[LoginErrorReason["SSO"] = 4] = "SSO";
|
|
30662
|
+
LoginErrorReason[LoginErrorReason["MFA_REQUIRED"] = 5] = "MFA_REQUIRED";
|
|
30652
30663
|
})(LoginErrorReason || (LoginErrorReason = {}));
|
|
30653
30664
|
class AuthInfo {
|
|
30654
30665
|
username;
|
|
@@ -31493,7 +31504,7 @@ class BaseEnterpriseBasketService {
|
|
|
31493
31504
|
this.getUserBasketsFetcher
|
|
31494
31505
|
.fetchList({
|
|
31495
31506
|
basketStatuses: [BasketStatus.Open],
|
|
31496
|
-
user: this.userService.getfullUserDetails(true)
|
|
31507
|
+
user: this.userService.getfullUserDetails(true)?.userData?.value?.user_id?.toString()
|
|
31497
31508
|
})
|
|
31498
31509
|
.pipe(take(1))
|
|
31499
31510
|
.subscribe((baskets) => {
|
|
@@ -31885,7 +31896,7 @@ class BaseEnterpriseBasketService {
|
|
|
31885
31896
|
async findOrCreateBasket(id, getBookedBasket = false, createdByGut = false) {
|
|
31886
31897
|
let basket = null;
|
|
31887
31898
|
if (!id) {
|
|
31888
|
-
let allOpenBaskets = await this.getAllOpenBaskets(this.userService.getfullUserDetails(true)
|
|
31899
|
+
let allOpenBaskets = await this.getAllOpenBaskets(this.userService.getfullUserDetails(true)?.userData?.value?.user_id?.toString());
|
|
31889
31900
|
if (!this.userService.bobo) {
|
|
31890
31901
|
// ENT-3276 remove baskest with invoked user if we are not currently invoking a user // ? - should we do the opposite as well?
|
|
31891
31902
|
allOpenBaskets = allOpenBaskets.filter(basket => !basket.invokedUser);
|
|
@@ -32841,20 +32852,21 @@ class BaseEnterpriseBasketService {
|
|
|
32841
32852
|
}
|
|
32842
32853
|
async updateExchangeBasket(data) {
|
|
32843
32854
|
const updatedBasket = await this.updateExchangeBasketUpdater.updateOne(data).toPromise();
|
|
32844
|
-
|
|
32845
|
-
|
|
32846
|
-
|
|
32847
|
-
|
|
32848
|
-
|
|
32849
|
-
|
|
32850
|
-
|
|
32851
|
-
|
|
32852
|
-
convertCurrencyTo: this.userCurrency,
|
|
32853
|
-
id: data.basket,
|
|
32854
|
-
withSupplemental: true
|
|
32855
|
-
}).toPromise();
|
|
32856
|
-
return updatedExchange;
|
|
32855
|
+
if (data.reasonKeys !== null) {
|
|
32856
|
+
const selectedItem = updatedBasket.basketItems.filter(item => item.id === data.basketItemId);
|
|
32857
|
+
const reasonAction = await this.requiresService.checkBasketReason(updatedBasket, selectedItem);
|
|
32858
|
+
if (!reasonAction) {
|
|
32859
|
+
delete data.reasonKeys;
|
|
32860
|
+
await this.updateExchangeBasketUpdater.updateOne(data).toPromise();
|
|
32861
|
+
return;
|
|
32862
|
+
}
|
|
32857
32863
|
}
|
|
32864
|
+
const updatedExchange = await this.getBasket({
|
|
32865
|
+
convertCurrencyTo: this.userCurrency,
|
|
32866
|
+
id: data.basket,
|
|
32867
|
+
withSupplemental: true
|
|
32868
|
+
}).toPromise();
|
|
32869
|
+
return updatedExchange;
|
|
32858
32870
|
}
|
|
32859
32871
|
}
|
|
32860
32872
|
|
|
@@ -35169,7 +35181,7 @@ class BaseUserService {
|
|
|
35169
35181
|
return this.fullUserDetails || this.storageService.getSessionItem('lightning_user_data');
|
|
35170
35182
|
}
|
|
35171
35183
|
getProfileConfig() {
|
|
35172
|
-
return this.fullUserDetails.allDetails.value
|
|
35184
|
+
return this.fullUserDetails.allDetails.value?.profileConfig;
|
|
35173
35185
|
}
|
|
35174
35186
|
getUserDropdownInfo() {
|
|
35175
35187
|
const dropdown_info = {
|
|
@@ -35279,6 +35291,7 @@ class BaseUserService {
|
|
|
35279
35291
|
this.fullUserDetails.userConfigs.next(null);
|
|
35280
35292
|
this.fullUserDetails.userServices.next(null);
|
|
35281
35293
|
this.fullUserDetails.messages.next(null);
|
|
35294
|
+
this.fullUserDetails.allDetails.next(null);
|
|
35282
35295
|
this.changeUser.next(this.fullUserDetails);
|
|
35283
35296
|
}
|
|
35284
35297
|
createGuestUser(title, forename, surname, email, guestMobileCountryNo, guestMobileNumber, guest_nationality, gender, isChild, isInfant, childDOB) {
|
|
@@ -35316,34 +35329,34 @@ class BaseUserService {
|
|
|
35316
35329
|
return services && !!services[service];
|
|
35317
35330
|
}
|
|
35318
35331
|
isTraveller() {
|
|
35319
|
-
return this.fullUserDetails.userData.value
|
|
35332
|
+
return this.fullUserDetails.userData.value?.booker_type === BookerType.Traveller;
|
|
35320
35333
|
}
|
|
35321
35334
|
userIsAgent() {
|
|
35322
35335
|
return this.fullUserDetails.userData.value?.agent_booker;
|
|
35323
35336
|
}
|
|
35324
35337
|
canOverrideApproval() {
|
|
35325
|
-
return this.fullUserDetails.allDetails.value
|
|
35338
|
+
return this.fullUserDetails.allDetails.value?.canOverrideApproval;
|
|
35326
35339
|
}
|
|
35327
35340
|
userIsAdmin() {
|
|
35328
|
-
return this.fullUserDetails.userData.value
|
|
35341
|
+
return this.fullUserDetails.userData.value?.admin;
|
|
35329
35342
|
}
|
|
35330
35343
|
userIsCompanyAdmin() {
|
|
35331
|
-
return this.fullUserDetails.userData.value
|
|
35344
|
+
return this.fullUserDetails.userData.value?.company_admin;
|
|
35332
35345
|
}
|
|
35333
35346
|
userIsTmcAdmin() {
|
|
35334
|
-
return this.fullUserDetails.userData.value
|
|
35347
|
+
return this.fullUserDetails.userData.value?.tmc_admin;
|
|
35335
35348
|
}
|
|
35336
35349
|
userTmcId() {
|
|
35337
|
-
return this.fullUserDetails.userData.value
|
|
35350
|
+
return this.fullUserDetails.userData.value?.tmc_id;
|
|
35338
35351
|
}
|
|
35339
35352
|
isSelfBook() {
|
|
35340
|
-
return this.fullUserDetails.userData.value
|
|
35353
|
+
return this.fullUserDetails.userData.value?.booker_type === BookerType.SelfBook;
|
|
35341
35354
|
}
|
|
35342
35355
|
isBooker() {
|
|
35343
|
-
return this.fullUserDetails.userData.value
|
|
35356
|
+
return this.fullUserDetails.userData.value?.booker_type === BookerType.Booker;
|
|
35344
35357
|
}
|
|
35345
35358
|
getUserId() {
|
|
35346
|
-
return this.fullUserDetails.userData.value
|
|
35359
|
+
return this.fullUserDetails.userData.value?.user_id;
|
|
35347
35360
|
}
|
|
35348
35361
|
getUserPrimaryAddress(userId) {
|
|
35349
35362
|
return this.getUser(userId).pipe(map$1((user) => user.addresses || []), map$1((addresses) => {
|
|
@@ -35373,10 +35386,10 @@ class BaseUserService {
|
|
|
35373
35386
|
return this.baseConfirmMessagesUpdater.updateOne({ messages: id });
|
|
35374
35387
|
}
|
|
35375
35388
|
userIsRoot() {
|
|
35376
|
-
return this.fullUserDetails.userData.value
|
|
35389
|
+
return this.fullUserDetails.userData.value?.booker_type === BookerType.Root;
|
|
35377
35390
|
}
|
|
35378
35391
|
userIsSupportAgent() {
|
|
35379
|
-
return !!this.fullUserDetails.userData.value
|
|
35392
|
+
return !!this.fullUserDetails.userData.value?.support_agent;
|
|
35380
35393
|
}
|
|
35381
35394
|
getUserCompanies(query = null) {
|
|
35382
35395
|
return query
|
|
@@ -35390,31 +35403,23 @@ class BaseUserService {
|
|
|
35390
35403
|
return this.getOfficeUserFetcher.fetchList({ id }).pipe(take(1));
|
|
35391
35404
|
}
|
|
35392
35405
|
getUserCompany() {
|
|
35393
|
-
return this.getCompanyById(this.fullUserDetails.userData.value
|
|
35406
|
+
return this.getCompanyById(this.fullUserDetails.userData.value?.company_id?.toString());
|
|
35394
35407
|
}
|
|
35395
35408
|
getUser(userId) {
|
|
35396
|
-
const
|
|
35397
|
-
return this.getUserFetcher.fetchOne({
|
|
35398
|
-
id: userId ? userId : user.userData.value.user_id.toString()
|
|
35399
|
-
});
|
|
35409
|
+
const resolvedUserId = userId ?? this.fullUserDetails.userData.value?.user_id?.toString();
|
|
35410
|
+
return this.getUserFetcher.fetchOne({ id: resolvedUserId });
|
|
35400
35411
|
}
|
|
35401
35412
|
getUserMi(userId) {
|
|
35402
|
-
const
|
|
35403
|
-
return this.userMiFetcher.fetchOne({
|
|
35404
|
-
id: userId ? userId : user.userData.value.user_id.toString()
|
|
35405
|
-
});
|
|
35413
|
+
const resolvedUserId = userId ?? this.fullUserDetails.userData.value?.user_id?.toString();
|
|
35414
|
+
return this.userMiFetcher.fetchOne({ id: resolvedUserId });
|
|
35406
35415
|
}
|
|
35407
35416
|
getUserDocumentLoyalty(userId) {
|
|
35408
|
-
const
|
|
35409
|
-
return this.UserDocumentLoyalty.fetchOne({
|
|
35410
|
-
id: userId ? userId : user.userData.value.user_id.toString()
|
|
35411
|
-
});
|
|
35417
|
+
const resolvedUserId = userId ?? this.fullUserDetails.userData.value?.user_id?.toString();
|
|
35418
|
+
return this.UserDocumentLoyalty.fetchOne({ id: resolvedUserId });
|
|
35412
35419
|
}
|
|
35413
35420
|
getUserEmergencyContact(userId) {
|
|
35414
|
-
const
|
|
35415
|
-
return this.UserEmergencyContact.fetchOne({
|
|
35416
|
-
id: userId ? userId : user.userData.value.user_id.toString()
|
|
35417
|
-
});
|
|
35421
|
+
const resolvedUserId = userId ?? this.fullUserDetails.userData.value?.user_id?.toString();
|
|
35422
|
+
return this.UserEmergencyContact.fetchOne({ id: resolvedUserId });
|
|
35418
35423
|
}
|
|
35419
35424
|
setUserLanguage(id) {
|
|
35420
35425
|
return this.setUserLanguageUpdater.updateOne({ language: id });
|
|
@@ -35436,7 +35441,7 @@ class BaseUserService {
|
|
|
35436
35441
|
return this.getUserGuestsFetcher.fetchList({ officeId });
|
|
35437
35442
|
}
|
|
35438
35443
|
canInvokeUser() {
|
|
35439
|
-
return this.fullUserDetails.allDetails.value
|
|
35444
|
+
return this.fullUserDetails.allDetails.value?.canInvokeUser;
|
|
35440
35445
|
}
|
|
35441
35446
|
getOffice() {
|
|
35442
35447
|
return this.getOfficeFetcher.fetchList();
|
|
@@ -35463,13 +35468,13 @@ class BaseUserService {
|
|
|
35463
35468
|
return !!this.fullUserDetails.allDetails.value;
|
|
35464
35469
|
}
|
|
35465
35470
|
ermCompanyType() {
|
|
35466
|
-
return this.fullUserDetails.userData.value
|
|
35471
|
+
return this.fullUserDetails.userData.value?.company_type;
|
|
35467
35472
|
}
|
|
35468
35473
|
getSearchCompanyApprovers(email) {
|
|
35469
35474
|
return this.searchCompanyApproversFetcher.fetchList({ email });
|
|
35470
35475
|
}
|
|
35471
35476
|
isUserAgentBook() {
|
|
35472
|
-
return this.fullUserDetails.userData.value
|
|
35477
|
+
return this.fullUserDetails.userData.value?.agent_booker;
|
|
35473
35478
|
}
|
|
35474
35479
|
getPreferenceValues() {
|
|
35475
35480
|
return PREFERENCE_VALUES;
|
|
@@ -35600,17 +35605,17 @@ class BaseUserService {
|
|
|
35600
35605
|
}
|
|
35601
35606
|
userIsAnApprover() {
|
|
35602
35607
|
const user = this.getfullUserDetails();
|
|
35603
|
-
return user
|
|
35608
|
+
return user?.allDetails?.value?.approver;
|
|
35604
35609
|
}
|
|
35605
35610
|
/**
|
|
35606
35611
|
* @description - returns if a user is enabled for singlesignon ONLY - if user has more than one authentication method returns false
|
|
35607
35612
|
*/
|
|
35608
35613
|
userIsSSO() {
|
|
35609
35614
|
const user = this.getfullUserDetails();
|
|
35610
|
-
return ((user?.allDetails
|
|
35611
|
-
user?.allDetails
|
|
35612
|
-
(user?.allDetails
|
|
35613
|
-
user?.allDetails
|
|
35615
|
+
return ((user?.allDetails?.value?.authMethods?.length === 1 &&
|
|
35616
|
+
user?.allDetails?.value?.authMethods?.includes('singlesignon')) ||
|
|
35617
|
+
(user?.allDetails?.value?.company?.authMethods?.length === 1 &&
|
|
35618
|
+
user?.allDetails?.value?.company?.authMethods?.includes('singlesignon')));
|
|
35614
35619
|
}
|
|
35615
35620
|
deleteGuest(id) {
|
|
35616
35621
|
return this.deleteGuestUpdater.updateOne({
|
|
@@ -35645,7 +35650,7 @@ class BaseUserService {
|
|
|
35645
35650
|
return this.removePreferredTransportHubUpdater.updateOne({ serviceType, hubCode });
|
|
35646
35651
|
}
|
|
35647
35652
|
canSeeBookingsOfOthers() {
|
|
35648
|
-
return this.fullUserDetails.allDetails.value
|
|
35653
|
+
return this.fullUserDetails.allDetails.value?.canSeeBookingsOfOthers;
|
|
35649
35654
|
}
|
|
35650
35655
|
getUserMiStack(userId, defaultValueConsumingOnly, serviceId) {
|
|
35651
35656
|
const query = { userId, defaultValueConsumingOnly, serviceId };
|
|
@@ -39378,7 +39383,7 @@ class BaseEnterpriseSearchService {
|
|
|
39378
39383
|
}
|
|
39379
39384
|
validateTravellers() {
|
|
39380
39385
|
this.travellerValidationMessages = [];
|
|
39381
|
-
switch (this.userService.fullUserDetails.userData.value
|
|
39386
|
+
switch (this.userService.fullUserDetails.userData.value?.booker_type) {
|
|
39382
39387
|
case BookerType.SelfBook:
|
|
39383
39388
|
if (!(this.selectedTravellers.length === 1 && this.travellersContainUser())) {
|
|
39384
39389
|
// this should never trigger under normal conditions as the user should be loaded in as a traveller on login
|
|
@@ -40885,6 +40890,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
40885
40890
|
var URLS;
|
|
40886
40891
|
(function (URLS) {
|
|
40887
40892
|
URLS["AccessToken"] = "accessToken";
|
|
40893
|
+
URLS["LoginMfa"] = "loginMfa";
|
|
40894
|
+
URLS["ReissueMfaToken"] = "reissueMfaToken";
|
|
40888
40895
|
URLS["LOGOUT_URL"] = "logout";
|
|
40889
40896
|
URLS["Refresh"] = "refreshToken";
|
|
40890
40897
|
URLS["CONFERMA_THUMBNAIL_URL"] = "https://ssl.conferma.com/Images/PropertyThumbnails/";
|
|
@@ -41034,8 +41041,19 @@ class BaseLogonService {
|
|
|
41034
41041
|
this.searchService.reset();
|
|
41035
41042
|
this.searchService.resetSearchParams();
|
|
41036
41043
|
this.basketService.reset();
|
|
41037
|
-
|
|
41038
|
-
|
|
41044
|
+
const newUserId = data.jwtObject.user_id?.toString();
|
|
41045
|
+
this.userService.fullUserDetails.allDetails
|
|
41046
|
+
.pipe(filter(user => user?.id === newUserId), take(1), timeout(10000))
|
|
41047
|
+
.subscribe({
|
|
41048
|
+
next: () => {
|
|
41049
|
+
this.router.navigate(['main']);
|
|
41050
|
+
resolve(true);
|
|
41051
|
+
},
|
|
41052
|
+
error: () => {
|
|
41053
|
+
this.router.navigate(['main']);
|
|
41054
|
+
resolve(true);
|
|
41055
|
+
}
|
|
41056
|
+
});
|
|
41039
41057
|
}, error => {
|
|
41040
41058
|
this.becomingUser = false;
|
|
41041
41059
|
reject(error);
|
|
@@ -41086,6 +41104,16 @@ class BaseLogonService {
|
|
|
41086
41104
|
**/
|
|
41087
41105
|
handleResponse(data) {
|
|
41088
41106
|
if (typeof data === 'object' && data.jwt) {
|
|
41107
|
+
// Check if MFA is required (mfa_access_only flag in JWT)
|
|
41108
|
+
if (data.jwtObject?.mfa_access_only) {
|
|
41109
|
+
const loginResponse = {
|
|
41110
|
+
...data,
|
|
41111
|
+
mfa_access_only: data.jwtObject.mfa_access_only,
|
|
41112
|
+
mfa_expires_after_epoch_ms: data.jwtObject.mfa_expires_after_epoch_ms,
|
|
41113
|
+
user_id: data.jwtObject.user_id
|
|
41114
|
+
};
|
|
41115
|
+
throw new LoginError(LoginErrorReason.MFA_REQUIRED, loginResponse, undefined, undefined, 'MFA verification required');
|
|
41116
|
+
}
|
|
41089
41117
|
this.userService.setUser(data.jwtObject);
|
|
41090
41118
|
this.isLoggedIn = true;
|
|
41091
41119
|
delete data.jwt;
|
|
@@ -41101,6 +41129,25 @@ class BaseLogonService {
|
|
|
41101
41129
|
}
|
|
41102
41130
|
return data;
|
|
41103
41131
|
}
|
|
41132
|
+
/**
|
|
41133
|
+
* Submit MFA code for verification
|
|
41134
|
+
*/
|
|
41135
|
+
submitMfaCode(userId, mfaCode) {
|
|
41136
|
+
const request = { userId, mfaCode };
|
|
41137
|
+
return this.http
|
|
41138
|
+
.formEncodedPostNoErrorHandling(URLS.LoginMfa, request)
|
|
41139
|
+
.pipe(take(1), map$1((value) => {
|
|
41140
|
+
return this.handleResponse(value);
|
|
41141
|
+
}));
|
|
41142
|
+
}
|
|
41143
|
+
/**
|
|
41144
|
+
* Request a new MFA code to be sent via email
|
|
41145
|
+
*/
|
|
41146
|
+
resendMfaCode() {
|
|
41147
|
+
return this.http
|
|
41148
|
+
.formEncodedPostNoErrorHandling(URLS.ReissueMfaToken, {})
|
|
41149
|
+
.pipe(take(1));
|
|
41150
|
+
}
|
|
41104
41151
|
logout() {
|
|
41105
41152
|
const ssoUser = this.userService.userIsSSO();
|
|
41106
41153
|
console.log(`+++ User is SSO only: ${ssoUser} +++`);
|