@bluemarble/bm-components 1.14.0 → 1.15.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.
package/dist/index.d.mts CHANGED
@@ -392,7 +392,7 @@ interface ConstructorProps {
392
392
  scope: string;
393
393
  tenant_id: string;
394
394
  client_secret: string;
395
- onCreateUser: (fields: {
395
+ onCreateUser?: (fields: {
396
396
  email: string;
397
397
  fullname: string;
398
398
  }) => Promise<void>;
@@ -439,7 +439,7 @@ declare class AuthHelper {
439
439
  props?: undefined;
440
440
  } | {
441
441
  props: {
442
- destination: string;
442
+ error: string;
443
443
  };
444
444
  redirect?: undefined;
445
445
  }>;
package/dist/index.d.ts CHANGED
@@ -392,7 +392,7 @@ interface ConstructorProps {
392
392
  scope: string;
393
393
  tenant_id: string;
394
394
  client_secret: string;
395
- onCreateUser: (fields: {
395
+ onCreateUser?: (fields: {
396
396
  email: string;
397
397
  fullname: string;
398
398
  }) => Promise<void>;
@@ -439,7 +439,7 @@ declare class AuthHelper {
439
439
  props?: undefined;
440
440
  } | {
441
441
  props: {
442
- destination: string;
442
+ error: string;
443
443
  };
444
444
  redirect?: undefined;
445
445
  }>;
package/dist/index.js CHANGED
@@ -3995,7 +3995,7 @@ var Modal = (_a) => {
3995
3995
  {
3996
3996
  sx: {
3997
3997
  outline: "none",
3998
- backgroundColor: "white",
3998
+ backgroundColor: "background.paper",
3999
3999
  position: "absolute",
4000
4000
  top: "50%",
4001
4001
  left: "50%",
@@ -4427,7 +4427,7 @@ function decodeSessionToken({
4427
4427
  try {
4428
4428
  const decoded = jwtDecode(token);
4429
4429
  req.user = decoded.sub;
4430
- } catch (error) {
4430
+ } catch (_) {
4431
4431
  res.status(401).json({ error: "Token inv\xE1lido", code: "token.expired" });
4432
4432
  return true;
4433
4433
  }
@@ -4637,7 +4637,9 @@ var AuthHelper = class {
4637
4637
  try {
4638
4638
  const { fullName, email } = yield this.oauthSignInCallback(code);
4639
4639
  const userExists = yield this.onGetUserData(email);
4640
- if (!userExists && this.oauth) {
4640
+ if (!userExists && !this.oauth.onCreateUser)
4641
+ throw new Error("User does not exists");
4642
+ if (!userExists && this.oauth.onCreateUser) {
4641
4643
  yield this.oauth.onCreateUser({ fullname: fullName, email });
4642
4644
  }
4643
4645
  const { token, refreshToken } = yield this.generateJwtAndRefreshToken(
@@ -4664,10 +4666,9 @@ var AuthHelper = class {
4664
4666
  }
4665
4667
  };
4666
4668
  } catch (error) {
4667
- console.log(error);
4668
4669
  return {
4669
4670
  props: {
4670
- destination: onFailedDestination || "/"
4671
+ error: JSON.stringify(error)
4671
4672
  }
4672
4673
  };
4673
4674
  }