@block-auth.io/angular 0.7.0 → 0.7.1

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.
@@ -1,7 +1,7 @@
1
1
  import { DOCUMENT, isPlatformBrowser, NgComponentOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
3
  import { InjectionToken, makeEnvironmentProviders, inject, DestroyRef, signal, computed, Injectable, output, PLATFORM_ID, effect, Directive, ElementRef, input, ChangeDetectionStrategy, Component, viewChild, HostListener, untracked, linkedSignal, afterNextRender } from '@angular/core';
4
- import { createBlockAuthClient, $locale, setLocale, t, $user, getUserRoles, getUserRoleNames, getUserRoleSlugs, hasRole, hasRoleBySlug, hasAnyRole, hasAnyRoleBySlug, fetchUserProfile, startExtensionSync, createAuthRuntime, $extension, getExtensionStoreUrl, utils, getDefaultPhoneCountry, resolvePhoneDraft, getPhoneCountries, searchPhoneCountries, updatePhoneDraft, getSolicitedFields, getSolicitedParams, isSolicitedDataComplete, PARAM_LABEL_KEYS, PARAM_ERROR_KEYS, getSolicitedHintKey, PARAM_INPUT_TYPE, isSolicitedHintSuccess, isSolicitedEmailSelectable, formatSolicitedEmailOption, EMPTY_SOLICITED_DATA_FORM, openExtensionOnTxn, getSolicitedAcceptParams, setSolicitedValue, setSolicitedShared, saveSolicitedValue, undoSolicitedValue, setSolicitedEmailChoice, needsExtensionUnlock, deepLinkFor, makeQrDataUrl, setIsSigningLoader, AccountLinkError } from '@block-auth.io/core';
4
+ import { createBlockAuthClient, $locale, setLocale, t, $user, getUserRoles, getUserRoleNames, getUserRoleSlugs, hasRole, hasRoleBySlug, hasAnyRole, hasAnyRoleBySlug, fetchUserProfile, startExtensionSync, createAuthRuntime, $extension, getExtensionStoreUrl, utils, DEFAULT_PHONE_COUNTRY, resolvePhoneDraft, getPhoneCountries, searchPhoneCountries, updatePhoneDraft, getSolicitedFields, getSolicitedParams, isSolicitedDataComplete, PARAM_LABEL_KEYS, PARAM_ERROR_KEYS, getSolicitedHintKey, PARAM_INPUT_TYPE, isSolicitedHintSuccess, isSolicitedEmailSelectable, formatSolicitedEmailOption, EMPTY_SOLICITED_DATA_FORM, openExtensionOnTxn, getSolicitedAcceptParams, setSolicitedValue, setSolicitedShared, saveSolicitedValue, undoSolicitedValue, setSolicitedEmailChoice, needsExtensionUnlock, deepLinkFor, makeQrDataUrl, setIsSigningLoader, AccountLinkError } from '@block-auth.io/core';
5
5
  export { getUserRoleNames, getUserRoleSlugs, getUserRoles, hasAnyRole, hasAnyRoleBySlug, hasRole, hasRoleBySlug, loadUserProfile } from '@block-auth.io/core';
6
6
 
7
7
  // GENERADO por scripts/css-to-ts.mjs — no editar a mano.
@@ -5165,7 +5165,7 @@ class PhoneInputComponent {
5165
5165
  this.nationalInput = viewChild.required('nationalInput');
5166
5166
  this.search = viewChild('search', ...(ngDevMode ? [{ debugName: "search" }] : []));
5167
5167
  this.list = viewChild('list', ...(ngDevMode ? [{ debugName: "list" }] : []));
5168
- this.defaultCountry = getDefaultPhoneCountry();
5168
+ this.defaultCountry = DEFAULT_PHONE_COUNTRY;
5169
5169
  this.draft = linkedSignal(...(ngDevMode ? [{ debugName: "draft", source: this.value,
5170
5170
  computation: (value, previous) => resolvePhoneDraft(value, previous?.value ?? null, this.defaultCountry) }] : [{
5171
5171
  source: this.value,
@@ -9798,13 +9798,13 @@ class FlowBlockAuthComponent {
9798
9798
  return;
9799
9799
  const user = untracked(this.user);
9800
9800
  if (user)
9801
- this.client.rememberHostedLogin(user);
9801
+ this.client.rememberHostedLogin(user, { ownsAuthCode: Boolean(untracked(this.onAuthCode)) });
9802
9802
  else
9803
9803
  this.client.forgetHostedLogin();
9804
9804
  });
9805
9805
  }
9806
9806
  ngOnInit() {
9807
- if (!this.isHosted || this.user() !== undefined || !this.client.hasAuthEndpoint)
9807
+ if (!this.isHosted || this.user() !== undefined || !this.client.usesAuthEndpoint(Boolean(this.onAuthCode())))
9808
9808
  return;
9809
9809
  this.client.restoreHostedLogin().catch(() => this.errored.emit());
9810
9810
  }
@@ -9818,7 +9818,7 @@ class FlowBlockAuthComponent {
9818
9818
  .authorizeWithPopup()
9819
9819
  .then((code) => authCode(code))
9820
9820
  .then((user) => {
9821
- this.client.rememberHostedLogin(user);
9821
+ this.client.rememberHostedLogin(user, { ownsAuthCode: true });
9822
9822
  return user;
9823
9823
  })
9824
9824
  : this.client.hasAuthEndpoint