@equinor/mad-auth 0.1.21 → 0.1.23

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @equinor/mad-auth
2
2
 
3
+ ## 0.1.23
4
+
5
+ ### Patch Changes
6
+
7
+ - bfb69d7: Can no longer initiate authentication client multiple times
8
+
9
+ ## 0.1.22
10
+
11
+ ### Patch Changes
12
+
13
+ - af77bb9: getAccount/useAccount should now work for web
14
+
3
15
  ## 0.1.21
4
16
 
5
17
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getMadAccount,
3
3
  getMadAuthenticationResult
4
- } from "../chunk-6GAWEDT7.js";
4
+ } from "../chunk-763B4HQC.js";
5
5
  export {
6
6
  getMadAccount,
7
7
  getMadAuthenticationResult
package/dist/auth.js CHANGED
@@ -5,8 +5,8 @@ import {
5
5
  getAccount,
6
6
  initiateAuthenticationClient,
7
7
  signOut
8
- } from "./chunk-NRXJJLOK.js";
9
- import "./chunk-6GAWEDT7.js";
8
+ } from "./chunk-UT6IGOV7.js";
9
+ import "./chunk-763B4HQC.js";
10
10
  export {
11
11
  authenticateInteractively,
12
12
  authenticateSilently,
@@ -49,9 +49,10 @@ var __async = (__this, __arguments, generator) => {
49
49
 
50
50
  // src/_internal/translationLayer.ts
51
51
  var getMadAccount = (account) => {
52
+ var _a;
52
53
  return {
53
54
  username: account.username,
54
- name: account.claims.name || void 0,
55
+ name: (_a = account.claims) == null ? void 0 : _a.name,
55
56
  identifier: account.identifier
56
57
  };
57
58
  };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  useAuthenticate
3
- } from "./chunk-5TNEJPZM.js";
3
+ } from "./chunk-HIGCNJNC.js";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadValues
7
- } from "./chunk-6GAWEDT7.js";
7
+ } from "./chunk-763B4HQC.js";
8
8
 
9
9
  // src/components/LoginButton.tsx
10
10
  import React from "react";
@@ -3,10 +3,10 @@ import {
3
3
  authenticateSilently,
4
4
  authenticationClientExists,
5
5
  initiateAuthenticationClient
6
- } from "./chunk-NRXJJLOK.js";
6
+ } from "./chunk-UT6IGOV7.js";
7
7
  import {
8
8
  __async
9
- } from "./chunk-6GAWEDT7.js";
9
+ } from "./chunk-763B4HQC.js";
10
10
 
11
11
  // src/hooks/useAuthenticate.ts
12
12
  import { useEffect, useState } from "react";
@@ -2,7 +2,7 @@ import {
2
2
  __async,
3
3
  getMadAccount,
4
4
  getMadAuthenticationResult
5
- } from "./chunk-6GAWEDT7.js";
5
+ } from "./chunk-763B4HQC.js";
6
6
 
7
7
  // src/auth.ts
8
8
  import PublicClientApplication from "react-native-msal";
@@ -34,6 +34,8 @@ function initiateAuthenticationClient(_0) {
34
34
  redirectUri,
35
35
  authority = "https://login.microsoftonline.com/statoilsrm.onmicrosoft.com/"
36
36
  }) {
37
+ if (authenticationClientExists())
38
+ return;
37
39
  const config = {
38
40
  auth: {
39
41
  authority,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getAccount
3
- } from "./chunk-NRXJJLOK.js";
3
+ } from "./chunk-UT6IGOV7.js";
4
4
  import {
5
5
  __async
6
- } from "./chunk-6GAWEDT7.js";
6
+ } from "./chunk-763B4HQC.js";
7
7
 
8
8
  // src/hooks/useAccount.ts
9
9
  import { useEffect, useState } from "react";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  LoginButton
3
- } from "../chunk-6XZQ7DKI.js";
4
- import "../chunk-5TNEJPZM.js";
5
- import "../chunk-NRXJJLOK.js";
6
- import "../chunk-6GAWEDT7.js";
3
+ } from "../chunk-GCZJ767T.js";
4
+ import "../chunk-HIGCNJNC.js";
5
+ import "../chunk-UT6IGOV7.js";
6
+ import "../chunk-763B4HQC.js";
7
7
  export {
8
8
  LoginButton
9
9
  };
@@ -1,10 +1,10 @@
1
1
  import "../chunk-HAB34YS7.js";
2
2
  import {
3
3
  LoginButton
4
- } from "../chunk-6XZQ7DKI.js";
5
- import "../chunk-5TNEJPZM.js";
6
- import "../chunk-NRXJJLOK.js";
7
- import "../chunk-6GAWEDT7.js";
4
+ } from "../chunk-GCZJ767T.js";
5
+ import "../chunk-HIGCNJNC.js";
6
+ import "../chunk-UT6IGOV7.js";
7
+ import "../chunk-763B4HQC.js";
8
8
  export {
9
9
  LoginButton
10
10
  };
@@ -1,12 +1,12 @@
1
1
  import "../chunk-GUKC6UGZ.js";
2
2
  import {
3
3
  useAuthenticate
4
- } from "../chunk-5TNEJPZM.js";
4
+ } from "../chunk-HIGCNJNC.js";
5
5
  import {
6
6
  useAccount
7
- } from "../chunk-GJN2PRS3.js";
8
- import "../chunk-NRXJJLOK.js";
9
- import "../chunk-6GAWEDT7.js";
7
+ } from "../chunk-ZTEWSERJ.js";
8
+ import "../chunk-UT6IGOV7.js";
9
+ import "../chunk-763B4HQC.js";
10
10
  export {
11
11
  useAccount,
12
12
  useAuthenticate
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  useAccount
3
- } from "../chunk-GJN2PRS3.js";
4
- import "../chunk-NRXJJLOK.js";
5
- import "../chunk-6GAWEDT7.js";
3
+ } from "../chunk-ZTEWSERJ.js";
4
+ import "../chunk-UT6IGOV7.js";
5
+ import "../chunk-763B4HQC.js";
6
6
  export {
7
7
  useAccount
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  useAuthenticate
3
- } from "../chunk-5TNEJPZM.js";
4
- import "../chunk-NRXJJLOK.js";
5
- import "../chunk-6GAWEDT7.js";
3
+ } from "../chunk-HIGCNJNC.js";
4
+ import "../chunk-UT6IGOV7.js";
5
+ import "../chunk-763B4HQC.js";
6
6
  export {
7
7
  useAuthenticate
8
8
  };
package/dist/index.js CHANGED
@@ -2,14 +2,14 @@ import "./chunk-6F4PWJZI.js";
2
2
  import "./chunk-HAB34YS7.js";
3
3
  import {
4
4
  LoginButton
5
- } from "./chunk-6XZQ7DKI.js";
5
+ } from "./chunk-GCZJ767T.js";
6
6
  import "./chunk-GUKC6UGZ.js";
7
7
  import {
8
8
  useAuthenticate
9
- } from "./chunk-5TNEJPZM.js";
9
+ } from "./chunk-HIGCNJNC.js";
10
10
  import {
11
11
  useAccount
12
- } from "./chunk-GJN2PRS3.js";
12
+ } from "./chunk-ZTEWSERJ.js";
13
13
  import {
14
14
  authenticateInteractively,
15
15
  authenticateSilently,
@@ -17,8 +17,8 @@ import {
17
17
  getAccount,
18
18
  initiateAuthenticationClient,
19
19
  signOut
20
- } from "./chunk-NRXJJLOK.js";
21
- import "./chunk-6GAWEDT7.js";
20
+ } from "./chunk-UT6IGOV7.js";
21
+ import "./chunk-763B4HQC.js";
22
22
  export {
23
23
  LoginButton,
24
24
  authenticateInteractively,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/mad-auth",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "A simple wrapper library for react-native-msal",
5
5
  "type": "module",
6
6
  "keywords": [