strapi-plugin-firebase-authentication 1.1.8 → 1.1.10

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.
@@ -7,13 +7,13 @@ const reactTooltip = require("@radix-ui/react-tooltip");
7
7
  const React = require("react");
8
8
  const designSystem = require("@strapi/design-system");
9
9
  const reactIntl = require("react-intl");
10
- const index = require("./index-BIHS9XB4.js");
10
+ const index = require("./index-Dz1nqS7B.js");
11
11
  const icons = require("@strapi/icons");
12
12
  const styled = require("styled-components");
13
13
  const rx = require("react-icons/rx");
14
14
  const ai = require("react-icons/ai");
15
15
  const md = require("react-icons/md");
16
- const api = require("./api-CxfueBVM.js");
16
+ const api = require("./api-C7A4Ky3o.js");
17
17
  const PhoneInputModule = require("react-phone-input-2");
18
18
  require("react-phone-input-2/lib/style.css");
19
19
  const validator = require("validator");
@@ -2990,7 +2990,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
2990
2990
  var ys = arrObjKeys(obj, inspect2);
2991
2991
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
2992
2992
  var protoTag = obj instanceof Object ? "" : "null prototype";
2993
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
2993
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
2994
2994
  var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
2995
2995
  var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
2996
2996
  if (ys.length === 0) {
@@ -3015,25 +3015,25 @@ function canTrustToString(obj) {
3015
3015
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
3016
3016
  }
3017
3017
  function isArray$3(obj) {
3018
- return toStr(obj) === "[object Array]" && canTrustToString(obj);
3018
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
3019
3019
  }
3020
3020
  function isDate(obj) {
3021
- return toStr(obj) === "[object Date]" && canTrustToString(obj);
3021
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
3022
3022
  }
3023
3023
  function isRegExp$1(obj) {
3024
- return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
3024
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
3025
3025
  }
3026
3026
  function isError(obj) {
3027
- return toStr(obj) === "[object Error]" && canTrustToString(obj);
3027
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
3028
3028
  }
3029
3029
  function isString(obj) {
3030
- return toStr(obj) === "[object String]" && canTrustToString(obj);
3030
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
3031
3031
  }
3032
3032
  function isNumber(obj) {
3033
- return toStr(obj) === "[object Number]" && canTrustToString(obj);
3033
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
3034
3034
  }
3035
3035
  function isBoolean(obj) {
3036
- return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
3036
+ return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
3037
3037
  }
3038
3038
  function isSymbol(obj) {
3039
3039
  if (hasShammedSymbols) {
@@ -3069,7 +3069,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
3069
3069
  function has$3(obj, key) {
3070
3070
  return hasOwn$1.call(obj, key);
3071
3071
  }
3072
- function toStr(obj) {
3072
+ function toStr$1(obj) {
3073
3073
  return objectToString.call(obj);
3074
3074
  }
3075
3075
  function nameOf(f) {
@@ -3378,7 +3378,7 @@ var syntax = SyntaxError;
3378
3378
  var uri = URIError;
3379
3379
  var abs$1 = Math.abs;
3380
3380
  var floor$1 = Math.floor;
3381
- var max$1 = Math.max;
3381
+ var max$2 = Math.max;
3382
3382
  var min$1 = Math.min;
3383
3383
  var pow$1 = Math.pow;
3384
3384
  var round$1 = Math.round;
@@ -3507,99 +3507,78 @@ function requireObject_getPrototypeOf() {
3507
3507
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
3508
3508
  return Object_getPrototypeOf;
3509
3509
  }
3510
- var implementation;
3511
- var hasRequiredImplementation;
3512
- function requireImplementation() {
3513
- if (hasRequiredImplementation) return implementation;
3514
- hasRequiredImplementation = 1;
3515
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
3516
- var toStr2 = Object.prototype.toString;
3517
- var max2 = Math.max;
3518
- var funcType = "[object Function]";
3519
- var concatty = function concatty2(a3, b2) {
3520
- var arr = [];
3521
- for (var i2 = 0; i2 < a3.length; i2 += 1) {
3522
- arr[i2] = a3[i2];
3523
- }
3524
- for (var j = 0; j < b2.length; j += 1) {
3525
- arr[j + a3.length] = b2[j];
3526
- }
3527
- return arr;
3528
- };
3529
- var slicy = function slicy2(arrLike, offset) {
3530
- var arr = [];
3531
- for (var i2 = offset, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
3532
- arr[j] = arrLike[i2];
3533
- }
3534
- return arr;
3535
- };
3536
- var joiny = function(arr, joiner) {
3537
- var str = "";
3538
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
3539
- str += arr[i2];
3540
- if (i2 + 1 < arr.length) {
3541
- str += joiner;
3542
- }
3510
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
3511
+ var toStr = Object.prototype.toString;
3512
+ var max$1 = Math.max;
3513
+ var funcType = "[object Function]";
3514
+ var concatty = function concatty2(a3, b2) {
3515
+ var arr = [];
3516
+ for (var i2 = 0; i2 < a3.length; i2 += 1) {
3517
+ arr[i2] = a3[i2];
3518
+ }
3519
+ for (var j = 0; j < b2.length; j += 1) {
3520
+ arr[j + a3.length] = b2[j];
3521
+ }
3522
+ return arr;
3523
+ };
3524
+ var slicy = function slicy2(arrLike, offset) {
3525
+ var arr = [];
3526
+ for (var i2 = offset, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
3527
+ arr[j] = arrLike[i2];
3528
+ }
3529
+ return arr;
3530
+ };
3531
+ var joiny = function(arr, joiner) {
3532
+ var str = "";
3533
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
3534
+ str += arr[i2];
3535
+ if (i2 + 1 < arr.length) {
3536
+ str += joiner;
3543
3537
  }
3544
- return str;
3545
- };
3546
- implementation = function bind2(that) {
3547
- var target = this;
3548
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
3549
- throw new TypeError(ERROR_MESSAGE + target);
3550
- }
3551
- var args = slicy(arguments, 1);
3552
- var bound;
3553
- var binder = function() {
3554
- if (this instanceof bound) {
3555
- var result = target.apply(
3556
- this,
3557
- concatty(args, arguments)
3558
- );
3559
- if (Object(result) === result) {
3560
- return result;
3561
- }
3562
- return this;
3563
- }
3564
- return target.apply(
3565
- that,
3538
+ }
3539
+ return str;
3540
+ };
3541
+ var implementation$1 = function bind(that) {
3542
+ var target = this;
3543
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
3544
+ throw new TypeError(ERROR_MESSAGE + target);
3545
+ }
3546
+ var args = slicy(arguments, 1);
3547
+ var bound;
3548
+ var binder = function() {
3549
+ if (this instanceof bound) {
3550
+ var result = target.apply(
3551
+ this,
3566
3552
  concatty(args, arguments)
3567
3553
  );
3568
- };
3569
- var boundLength = max2(0, target.length - args.length);
3570
- var boundArgs = [];
3571
- for (var i2 = 0; i2 < boundLength; i2++) {
3572
- boundArgs[i2] = "$" + i2;
3573
- }
3574
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
3575
- if (target.prototype) {
3576
- var Empty = function Empty2() {
3577
- };
3578
- Empty.prototype = target.prototype;
3579
- bound.prototype = new Empty();
3580
- Empty.prototype = null;
3554
+ if (Object(result) === result) {
3555
+ return result;
3556
+ }
3557
+ return this;
3581
3558
  }
3582
- return bound;
3559
+ return target.apply(
3560
+ that,
3561
+ concatty(args, arguments)
3562
+ );
3583
3563
  };
3584
- return implementation;
3585
- }
3586
- var functionBind;
3587
- var hasRequiredFunctionBind;
3588
- function requireFunctionBind() {
3589
- if (hasRequiredFunctionBind) return functionBind;
3590
- hasRequiredFunctionBind = 1;
3591
- var implementation2 = requireImplementation();
3592
- functionBind = Function.prototype.bind || implementation2;
3593
- return functionBind;
3594
- }
3595
- var functionCall;
3596
- var hasRequiredFunctionCall;
3597
- function requireFunctionCall() {
3598
- if (hasRequiredFunctionCall) return functionCall;
3599
- hasRequiredFunctionCall = 1;
3600
- functionCall = Function.prototype.call;
3601
- return functionCall;
3602
- }
3564
+ var boundLength = max$1(0, target.length - args.length);
3565
+ var boundArgs = [];
3566
+ for (var i2 = 0; i2 < boundLength; i2++) {
3567
+ boundArgs[i2] = "$" + i2;
3568
+ }
3569
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
3570
+ if (target.prototype) {
3571
+ var Empty = function Empty2() {
3572
+ };
3573
+ Empty.prototype = target.prototype;
3574
+ bound.prototype = new Empty();
3575
+ Empty.prototype = null;
3576
+ }
3577
+ return bound;
3578
+ };
3579
+ var implementation = implementation$1;
3580
+ var functionBind = Function.prototype.bind || implementation;
3581
+ var functionCall = Function.prototype.call;
3603
3582
  var functionApply;
3604
3583
  var hasRequiredFunctionApply;
3605
3584
  function requireFunctionApply() {
@@ -3609,14 +3588,14 @@ function requireFunctionApply() {
3609
3588
  return functionApply;
3610
3589
  }
3611
3590
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
3612
- var bind$2 = requireFunctionBind();
3591
+ var bind$2 = functionBind;
3613
3592
  var $apply$1 = requireFunctionApply();
3614
- var $call$2 = requireFunctionCall();
3593
+ var $call$2 = functionCall;
3615
3594
  var $reflectApply = reflectApply;
3616
3595
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
3617
- var bind$1 = requireFunctionBind();
3596
+ var bind$1 = functionBind;
3618
3597
  var $TypeError$4 = type;
3619
- var $call$1 = requireFunctionCall();
3598
+ var $call$1 = functionCall;
3620
3599
  var $actualApply = actualApply;
3621
3600
  var callBindApplyHelpers = function callBindBasic(args) {
3622
3601
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -3682,8 +3661,8 @@ function requireHasown() {
3682
3661
  hasRequiredHasown = 1;
3683
3662
  var call = Function.prototype.call;
3684
3663
  var $hasOwn = Object.prototype.hasOwnProperty;
3685
- var bind2 = requireFunctionBind();
3686
- hasown = bind2.call(call, $hasOwn);
3664
+ var bind3 = functionBind;
3665
+ hasown = bind3.call(call, $hasOwn);
3687
3666
  return hasown;
3688
3667
  }
3689
3668
  var undefined$1;
@@ -3697,7 +3676,7 @@ var $TypeError$3 = type;
3697
3676
  var $URIError = uri;
3698
3677
  var abs = abs$1;
3699
3678
  var floor = floor$1;
3700
- var max = max$1;
3679
+ var max = max$2;
3701
3680
  var min = min$1;
3702
3681
  var pow = pow$1;
3703
3682
  var round = round$1;
@@ -3731,7 +3710,7 @@ var getProto = requireGetProto();
3731
3710
  var $ObjectGPO = requireObject_getPrototypeOf();
3732
3711
  var $ReflectGPO = requireReflect_getPrototypeOf();
3733
3712
  var $apply = requireFunctionApply();
3734
- var $call = requireFunctionCall();
3713
+ var $call = functionCall;
3735
3714
  var needsEval = {};
3736
3715
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
3737
3716
  var INTRINSICS = {
@@ -3902,13 +3881,13 @@ var LEGACY_ALIASES = {
3902
3881
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3903
3882
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3904
3883
  };
3905
- var bind = requireFunctionBind();
3884
+ var bind2 = functionBind;
3906
3885
  var hasOwn = requireHasown();
3907
- var $concat = bind.call($call, Array.prototype.concat);
3908
- var $spliceApply = bind.call($apply, Array.prototype.splice);
3909
- var $replace = bind.call($call, String.prototype.replace);
3910
- var $strSlice = bind.call($call, String.prototype.slice);
3911
- var $exec = bind.call($call, RegExp.prototype.exec);
3886
+ var $concat = bind2.call($call, Array.prototype.concat);
3887
+ var $spliceApply = bind2.call($apply, Array.prototype.splice);
3888
+ var $replace = bind2.call($call, String.prototype.replace);
3889
+ var $strSlice = bind2.call($call, String.prototype.slice);
3890
+ var $exec = bind2.call($call, RegExp.prototype.exec);
3912
3891
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
3913
3892
  var reEscapeChar = /\\(\\)?/g;
3914
3893
  var stringToPath = function stringToPath2(string) {
@@ -5466,16 +5445,17 @@ const StyledPhoneInputWrapper = styled__default.default.div`
5466
5445
 
5467
5446
  /* Flag dropdown button styles */
5468
5447
  .flag-dropdown {
5469
- background: transparent;
5448
+ background: transparent !important;
5470
5449
  border: none;
5471
5450
  border-right: none;
5472
5451
 
5473
5452
  &.open {
5453
+ background: transparent !important;
5474
5454
  z-index: 1001;
5475
5455
  }
5476
5456
 
5477
5457
  .selected-flag {
5478
- padding: 0 0 0 0.75rem;
5458
+ padding: 0 0.5rem 0 1rem;
5479
5459
  height: 40px;
5480
5460
  display: flex;
5481
5461
  align-items: center;
@@ -5489,8 +5469,26 @@ const StyledPhoneInputWrapper = styled__default.default.div`
5489
5469
  margin-left: 8px;
5490
5470
  }
5491
5471
 
5492
- &.open .arrow {
5493
- border-top-color: ${({ theme }) => theme.colors.neutral800};
5472
+ /* Fix flag background in all interactive states */
5473
+ &:hover,
5474
+ &:focus,
5475
+ &:active,
5476
+ &.open {
5477
+ background: transparent;
5478
+ background-color: transparent;
5479
+
5480
+ .arrow {
5481
+ border-top-color: ${({ theme }) => theme.colors.neutral800};
5482
+ }
5483
+
5484
+ .flag {
5485
+ background-color: transparent;
5486
+ }
5487
+ }
5488
+
5489
+ /* Fix flag background flash on initial load */
5490
+ .flag {
5491
+ background-color: transparent;
5494
5492
  }
5495
5493
  }
5496
5494
  }
@@ -5944,10 +5942,13 @@ const EditUserForm = ({ data }) => {
5944
5942
  setIsLoading(true);
5945
5943
  try {
5946
5944
  const updatedUser = await updateUser(userData.uid, userData);
5947
- if (updatedUser[0]?.status === "rejected") {
5948
- throw new Error("Error updating user");
5945
+ const result = updatedUser[0];
5946
+ if (result?.status === "rejected") {
5947
+ const errorReason = result.reason;
5948
+ const errorMessage = errorReason?.message || (errorReason?.code ? `Firebase error: ${errorReason.code}` : null) || "Error updating user";
5949
+ throw new Error(errorMessage);
5949
5950
  }
5950
- setUserData(updatedUser[0].value);
5951
+ setUserData(result.value);
5951
5952
  setIsLoading(false);
5952
5953
  toggleNotification({
5953
5954
  type: "success",
@@ -5955,9 +5956,10 @@ const EditUserForm = ({ data }) => {
5955
5956
  });
5956
5957
  } catch (error) {
5957
5958
  console.error("Error updating user:", error);
5959
+ const errorMessage = error instanceof Error ? error.message : "An error occurred while updating the user";
5958
5960
  toggleNotification({
5959
5961
  type: "danger",
5960
- message: "An error occurred while updating the user"
5962
+ message: errorMessage
5961
5963
  });
5962
5964
  setIsLoading(false);
5963
5965
  setUserData(data);
@@ -1,5 +1,5 @@
1
1
  import { getFetchClient } from "@strapi/strapi/admin";
2
- import { P as PLUGIN_ID } from "./index-Do9Y0scX.mjs";
2
+ import { P as PLUGIN_ID } from "./index-Dxg4gNu5.mjs";
3
3
  const saveFirebaseConfig = async (json, firebaseWebApiKey, passwordConfig) => {
4
4
  const url = `/${PLUGIN_ID}/settings/firebase-config`;
5
5
  const { post } = getFetchClient();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const admin = require("@strapi/strapi/admin");
3
- const index = require("./index-BIHS9XB4.js");
3
+ const index = require("./index-Dz1nqS7B.js");
4
4
  const saveFirebaseConfig = async (json, firebaseWebApiKey, passwordConfig) => {
5
5
  const url = `/${index.PLUGIN_ID}/settings/firebase-config`;
6
6
  const { post } = admin.getFetchClient();
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import { Flex, Box, Typography, JSONInput, Button, TextInput, Badge, Textarea, Toggle, NumberInput, Modal } from "@strapi/design-system";
4
4
  import { useNotification, Page } from "@strapi/strapi/admin";
5
- import { g as getFirebaseConfig, s as saveFirebaseConfig, d as delFirebaseConfig, a as savePasswordSettings } from "./api-T8QRCile.mjs";
5
+ import { g as getFirebaseConfig, s as saveFirebaseConfig, d as delFirebaseConfig, a as savePasswordSettings } from "./api-BznQNKgc.mjs";
6
6
  import { useNavigate } from "react-router-dom";
7
7
  function SettingsPage() {
8
8
  const { toggleNotification } = useNotification();
@@ -738,7 +738,7 @@ const index = {
738
738
  id: `${PLUGIN_ID}.page.title`,
739
739
  defaultMessage: PLUGIN_ID
740
740
  },
741
- Component: () => import("./App-Dt8F60Rl.mjs").then((mod) => ({
741
+ Component: () => import("./App-Beg-rhfs.mjs").then((mod) => ({
742
742
  default: mod.App
743
743
  })),
744
744
  permissions: PERMISSIONS["menu-link"]
@@ -760,7 +760,7 @@ const index = {
760
760
  id: "settings",
761
761
  to: `/settings/${PLUGIN_ID}`,
762
762
  async Component() {
763
- const component = await import("./index-BzSU0Li9.mjs");
763
+ const component = await import("./index-C3713gpv.mjs");
764
764
  return component.default;
765
765
  },
766
766
  permissions: PERMISSIONS["menu-link"]
@@ -739,7 +739,7 @@ const index = {
739
739
  id: `${PLUGIN_ID}.page.title`,
740
740
  defaultMessage: PLUGIN_ID
741
741
  },
742
- Component: () => Promise.resolve().then(() => require("./App-C_pWLYYH.js")).then((mod) => ({
742
+ Component: () => Promise.resolve().then(() => require("./App-Cd5yIsKz.js")).then((mod) => ({
743
743
  default: mod.App
744
744
  })),
745
745
  permissions: PERMISSIONS["menu-link"]
@@ -761,7 +761,7 @@ const index = {
761
761
  id: "settings",
762
762
  to: `/settings/${PLUGIN_ID}`,
763
763
  async Component() {
764
- const component = await Promise.resolve().then(() => require("./index-C87l6qcA.js"));
764
+ const component = await Promise.resolve().then(() => require("./index-d4XkRCYN.js"));
765
765
  return component.default;
766
766
  },
767
767
  permissions: PERMISSIONS["menu-link"]
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const admin = require("@strapi/strapi/admin");
7
- const api = require("./api-CxfueBVM.js");
7
+ const api = require("./api-C7A4Ky3o.js");
8
8
  const reactRouterDom = require("react-router-dom");
9
9
  function SettingsPage() {
10
10
  const { toggleNotification } = admin.useNotification();
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-BIHS9XB4.js");
2
+ const index = require("../_chunks/index-Dz1nqS7B.js");
3
3
  require("react/jsx-runtime");
4
4
  require("@strapi/strapi/admin");
5
5
  require("@strapi/design-system");
@@ -1,4 +1,4 @@
1
- import { p } from "../_chunks/index-Do9Y0scX.mjs";
1
+ import { p } from "../_chunks/index-Dxg4gNu5.mjs";
2
2
  import "react/jsx-runtime";
3
3
  import "@strapi/strapi/admin";
4
4
  import "@strapi/design-system";