@flusys/ng-auth 6.0.2 → 6.1.0

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.
@@ -46,6 +46,12 @@ class AuthApiService {
46
46
  switchCompany(data) {
47
47
  return this.http.post(`${this.baseUrl}/switch-company`, data);
48
48
  }
49
+ getCompanies() {
50
+ return this.http.post(`${this.baseUrl}/get-companies`, {});
51
+ }
52
+ getCompanyBranches(companyId) {
53
+ return this.http.post(`${this.baseUrl}/get-company-branches`, { companyId });
54
+ }
49
55
  refresh() {
50
56
  return this.http.post(`${this.baseUrl}/refresh`, {});
51
57
  }
@@ -715,8 +721,6 @@ const AUTH_MESSAGES = {
715
721
  'auth.password.change.current.required': 'Current password is required',
716
722
  'auth.password.reset.email.sent': 'Password reset email sent',
717
723
  'auth.password.reset.success': 'Password reset successfully',
718
- 'auth.token.expired': 'Token has expired',
719
- 'auth.token.revoked': 'Token has been revoked',
720
724
  'auth.token.too.large': 'Refresh token too large (≈{{size}} bytes)',
721
725
  'auth.company.list.success': 'User companies retrieved successfully',
722
726
  'auth.company.not.found': 'Company not found',
@@ -791,8 +795,6 @@ const AUTH_MESSAGES = {
791
795
  'user.permission.already.assigned': 'User already assigned to this {{type}}',
792
796
  'user.permission.not.found': '{{type}} permission not found',
793
797
  // === UI KEYS — AUTH DOMAIN (AUTH_ROUTES: login, register, forgot-password, reset-password, verify-email) ===
794
- // interceptors/token-refresh.interceptor.ts
795
- 'auth.session.expired.title': 'Session Expired',
796
798
  // pages/login/login-page.component.ts
797
799
  'auth.login.welcome': 'Welcome back!',
798
800
  'auth.login.sign.in.to.continue': 'Sign in to continue to your account',
@@ -1251,6 +1253,22 @@ class AuthLayoutApiAdapter {
1251
1253
  slug: permission.branchSlug ?? '',
1252
1254
  }))));
1253
1255
  }
1256
+ getMyCompanies() {
1257
+ return this.authApi.getCompanies().pipe(map$1((response) => (response.data || []).map((company) => ({
1258
+ id: company.id,
1259
+ name: company.name,
1260
+ slug: company.slug ?? '',
1261
+ imageId: company.logoId ?? '',
1262
+ }))));
1263
+ }
1264
+ getMyCompanyBranches(companyId) {
1265
+ return this.authApi.getCompanyBranches(companyId).pipe(map$1((response) => (response.data || []).map((branch) => ({
1266
+ id: branch.id,
1267
+ name: branch.name,
1268
+ slug: branch.slug ?? '',
1269
+ imageId: branch.logoId ?? undefined,
1270
+ }))));
1271
+ }
1254
1272
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AuthLayoutApiAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1255
1273
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AuthLayoutApiAdapter, providedIn: 'root' });
1256
1274
  }
@@ -1297,7 +1315,7 @@ class AuthUserProviderAdapter {
1297
1315
  messageVariables: response.messageVariables,
1298
1316
  data: (response.data ?? []).map((user) => ({
1299
1317
  id: user.id,
1300
- name: user.name ?? user.email,
1318
+ name: user.name || user.email,
1301
1319
  email: user.email,
1302
1320
  })),
1303
1321
  meta: response.meta,
@@ -2710,9 +2728,8 @@ class ForgotPasswordPageComponent {
2710
2728
  .forgotPassword(email)
2711
2729
  .pipe(takeUntilDestroyed(this.destroyRef), tap({
2712
2730
  next: () => this.showEmailSent(email),
2713
- error: () => { },
2714
2731
  }), finalize(() => this.isLoading.set(false)))
2715
- .subscribe();
2732
+ .subscribe({ error: () => { } });
2716
2733
  }
2717
2734
  showEmailSent(email) {
2718
2735
  this.submittedEmail.set(email);
@@ -7353,7 +7370,7 @@ class UserFormComponent {
7353
7370
  this.userFormExtension
7354
7371
  .saveExtraFieldValues(userId, extraFields)
7355
7372
  .pipe(takeUntilDestroyed(this.destroyRef))
7356
- .subscribe();
7373
+ .subscribe({ error: () => { } });
7357
7374
  }
7358
7375
  onSaveSuccess(message) {
7359
7376
  this.messageService.add({
@@ -7377,9 +7394,10 @@ class UserFormComponent {
7377
7394
  this.permissionService
7378
7395
  .assignUserToBranch(userId, branch.id)
7379
7396
  .pipe(takeUntilDestroyed(this.destroyRef))
7380
- .subscribe();
7397
+ .subscribe({ error: () => { } });
7381
7398
  }
7382
7399
  },
7400
+ error: () => { },
7383
7401
  });
7384
7402
  }
7385
7403
  onCancel() {