@snokam/auth 1.1.4 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -3,60 +3,376 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [1.1.4](https://github.com/snokam/components/compare/@snokam/auth@1.1.3...@snokam/auth@1.1.4) (2024-07-17)
6
+ # [2.0.0](https://github.com/snokam/components/compare/@snokam/auth@1.0.32-alpha.4...@snokam/auth@2.0.0) (2024-09-09)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
- * rewrite library to use typescript-fetch! ([e7bb8aa](https://github.com/snokam/components/commit/e7bb8aa8c8638bd8869589ea0d5c3364d451cf60))
12
- * types ([3c20479](https://github.com/snokam/components/commit/3c20479f4330878edc9144b28739c4b3bc53874c))
11
+ * clean up dependencies ([29d9836](https://github.com/snokam/components/commit/29d983669cea1c611eb423ffac322e0f8ae6a82a))
12
+ * trigger build ([ccb933a](https://github.com/snokam/components/commit/ccb933ab4106723a3c2cbd2a53691a0e9dd33e51))
13
+
14
+
15
+ ### Features
16
+
17
+ * revert "trigger build" ([a4e1c50](https://github.com/snokam/components/commit/a4e1c50a343e7fad606f72ab22075a43d4bf1c2d))
18
+
19
+
20
+ ### Performance Improvements
21
+
22
+ * **auth:** upgrade auth to new major ([7d4624a](https://github.com/snokam/components/commit/7d4624a4c3edfc5c5c093e84b9c87ede3b718488))
23
+
24
+
25
+ ### BREAKING CHANGES
26
+
27
+ * **auth:** Fix semantic versions.
28
+
29
+
30
+
31
+
32
+
33
+ ## [1.0.32-alpha.4](https://github.com/snokam/components/compare/@snokam/auth@1.0.32-alpha.3...@snokam/auth@1.0.32-alpha.4) (2024-09-09)
34
+
35
+
36
+ ### Reverts
37
+
38
+ * Revert "fix: peer dependencies for everything" ([19d6697](https://github.com/snokam/components/commit/19d6697ef42ea78db4c7ca1db438064f1e09c3d7))
39
+
40
+
41
+
42
+
43
+
44
+ ## [1.0.32-alpha.3](https://github.com/snokam/components/compare/@snokam/auth@1.0.32-alpha.2...@snokam/auth@1.0.32-alpha.3) (2024-09-08)
45
+
46
+ **Note:** Version bump only for package @snokam/auth
47
+
48
+
49
+
50
+
51
+
52
+ ## [1.0.32-alpha.2](https://github.com/snokam/components/compare/@snokam/auth@1.0.32-alpha.1...@snokam/auth@1.0.32-alpha.2) (2024-09-08)
53
+
54
+ **Note:** Version bump only for package @snokam/auth
55
+
13
56
 
14
57
 
15
58
 
16
59
 
60
+ ## [1.0.32-alpha.1](https://github.com/snokam/components/compare/@snokam/auth@1.0.32-alpha.0...@snokam/auth@1.0.32-alpha.1) (2024-09-08)
17
61
 
18
- ## [1.1.3](https://github.com/snokam/components/compare/@snokam/auth@1.1.2...@snokam/auth@1.1.3) (2024-07-17)
62
+ **Note:** Version bump only for package @snokam/auth
63
+
64
+
65
+
66
+
67
+
68
+ ## [1.0.32-alpha.0](https://github.com/snokam/components/compare/@snokam/auth@1.0.31...@snokam/auth@1.0.32-alpha.0) (2024-09-08)
19
69
 
20
70
 
21
71
  ### Bug Fixes
22
72
 
23
- * cleanup ([69e73b4](https://github.com/snokam/components/commit/69e73b42e3ec6aedd2e9d1ab798b67c35f5fd3af))
24
- * update deps ([ac90b46](https://github.com/snokam/components/commit/ac90b4651e99404d22eadebd7385e99337a74dd2))
73
+ * peer dependencies for everything ([694f8fa](https://github.com/snokam/components/commit/694f8fa4de2f1d94fc6fd58db519ee8efa1e20e0))
74
+
75
+
76
+
25
77
 
26
78
 
79
+ ## [1.0.31](https://github.com/snokam/components/compare/@snokam/auth@1.0.30...@snokam/auth@1.0.31) (2024-09-08)
27
80
 
81
+ **Note:** Version bump only for package @snokam/auth
28
82
 
29
83
 
30
- ## [1.1.2](https://github.com/snokam/components/compare/@snokam/auth@1.1.1...@snokam/auth@1.1.2) (2024-07-17)
84
+
85
+
86
+
87
+ ## [1.0.30](https://github.com/snokam/components/compare/@snokam/auth@1.0.29...@snokam/auth@1.0.30) (2024-09-08)
31
88
 
32
89
 
33
90
  ### Bug Fixes
34
91
 
35
- * try to fix types ([4b1dc2b](https://github.com/snokam/components/commit/4b1dc2b5133ef23e685c225ce12b2f3c7d69bbe3))
92
+ * update all peer deps ([343088a](https://github.com/snokam/components/commit/343088a2bee2cf07a49a0dfe6c6ab99b480a05cc))
36
93
 
37
94
 
38
95
 
39
96
 
40
97
 
41
- ## [1.1.1](https://github.com/snokam/components/compare/@snokam/auth@1.1.0...@snokam/auth@1.1.1) (2024-07-17)
98
+ ## [1.0.29](https://github.com/snokam/components/compare/@snokam/auth@1.0.28...@snokam/auth@1.0.29) (2024-09-08)
42
99
 
43
100
 
44
101
  ### Bug Fixes
45
102
 
46
- * add useClient function ([a0beff3](https://github.com/snokam/components/commit/a0beff349c625a7f1823fe91de8b30d64a26b5fd))
103
+ * remove lerna ignore ([25ce4d2](https://github.com/snokam/components/commit/25ce4d2013e03eca457501f19c0c406d8e379fc0))
104
+
105
+
106
+
107
+
108
+
109
+ ## [1.0.28](https://github.com/snokam/components/compare/@snokam/auth@1.0.27...@snokam/auth@1.0.28) (2024-09-04)
110
+
111
+ **Note:** Version bump only for package @snokam/auth
112
+
113
+
114
+
115
+
116
+
117
+ ## [1.0.27](https://github.com/snokam/components/compare/@snokam/auth@1.0.26...@snokam/auth@1.0.27) (2024-09-01)
118
+
119
+ **Note:** Version bump only for package @snokam/auth
120
+
121
+
122
+
123
+
124
+
125
+ ## [1.0.26](https://github.com/snokam/components/compare/@snokam/auth@1.0.25...@snokam/auth@1.0.26) (2024-09-01)
126
+
127
+ **Note:** Version bump only for package @snokam/auth
128
+
47
129
 
48
130
 
49
131
 
50
132
 
133
+ ## [1.0.25](https://github.com/snokam/components/compare/@snokam/auth@1.0.24...@snokam/auth@1.0.25) (2024-08-31)
51
134
 
52
- # 1.1.0 (2024-07-17)
135
+ **Note:** Version bump only for package @snokam/auth
136
+
137
+
138
+
139
+
140
+
141
+ ## [1.0.24](https://github.com/snokam/components/compare/@snokam/auth@1.0.23...@snokam/auth@1.0.24) (2024-08-31)
142
+
143
+ **Note:** Version bump only for package @snokam/auth
144
+
145
+
146
+
147
+
148
+
149
+ ## [1.0.23](https://github.com/snokam/components/compare/@snokam/auth@1.0.22...@snokam/auth@1.0.23) (2024-08-31)
150
+
151
+ **Note:** Version bump only for package @snokam/auth
152
+
153
+
154
+
155
+
156
+
157
+ ## [1.0.22](https://github.com/snokam/components/compare/@snokam/auth@1.0.21...@snokam/auth@1.0.22) (2024-08-31)
53
158
 
54
159
 
55
160
  ### Bug Fixes
56
161
 
57
- * paths for auth ([72673fe](https://github.com/snokam/components/commit/72673fec2e81779566283b15d06c2e163667428d))
162
+ * add error for AZURE_AD_SECRET" ([9654d6f](https://github.com/snokam/components/commit/9654d6f6228777c9786bda102286bccce021d924))
58
163
 
59
164
 
60
- ### Features
61
165
 
62
- * add auth package ([26cadad](https://github.com/snokam/components/commit/26cadadfc53812863e10931daff039f00e7c866a))
166
+
167
+
168
+ ## [1.0.21](https://github.com/snokam/components/compare/@snokam/auth@1.0.20...@snokam/auth@1.0.21) (2024-08-31)
169
+
170
+ **Note:** Version bump only for package @snokam/auth
171
+
172
+
173
+
174
+
175
+
176
+ ## [1.0.20](https://github.com/snokam/components/compare/@snokam/auth@1.0.19...@snokam/auth@1.0.20) (2024-08-31)
177
+
178
+ **Note:** Version bump only for package @snokam/auth
179
+
180
+
181
+
182
+
183
+
184
+ ## [1.0.19](https://github.com/snokam/components/compare/@snokam/auth@1.0.18...@snokam/auth@1.0.19) (2024-08-31)
185
+
186
+ **Note:** Version bump only for package @snokam/auth
187
+
188
+
189
+
190
+
191
+
192
+ ## [1.0.18](https://github.com/snokam/components/compare/@snokam/auth@1.0.17...@snokam/auth@1.0.18) (2024-08-28)
193
+
194
+ **Note:** Version bump only for package @snokam/auth
195
+
196
+
197
+
198
+
199
+
200
+ ## [1.0.17](https://github.com/snokam/components/compare/@snokam/auth@1.0.16...@snokam/auth@1.0.17) (2024-08-28)
201
+
202
+ **Note:** Version bump only for package @snokam/auth
203
+
204
+
205
+
206
+
207
+
208
+ ## [1.0.16](https://github.com/snokam/components/compare/@snokam/auth@1.0.15...@snokam/auth@1.0.16) (2024-08-28)
209
+
210
+ **Note:** Version bump only for package @snokam/auth
211
+
212
+
213
+
214
+
215
+
216
+ ## [1.0.15](https://github.com/snokam/components/compare/@snokam/auth@1.0.14...@snokam/auth@1.0.15) (2024-08-28)
217
+
218
+
219
+ ### Bug Fixes
220
+
221
+ * add typesVersions ([d23573d](https://github.com/snokam/components/commit/d23573d5cce1c4aff4cbcf62be17b6409056e3eb))
222
+ * remove prefix ([15f3175](https://github.com/snokam/components/commit/15f31752576c8f4e41e0da9e0829d8596291fb7f))
223
+
224
+
225
+
226
+
227
+
228
+ ## [1.0.14](https://github.com/snokam/components/compare/@snokam/auth@1.0.13...@snokam/auth@1.0.14) (2024-08-28)
229
+
230
+
231
+ ### Bug Fixes
232
+
233
+ * add bundler ([5f746aa](https://github.com/snokam/components/commit/5f746aa19fc3320ef8d577645b82960676e1a1ea))
234
+
235
+
236
+
237
+
238
+
239
+ ## [1.0.13](https://github.com/snokam/components/compare/@snokam/auth@1.0.12...@snokam/auth@1.0.13) (2024-08-28)
240
+
241
+
242
+ ### Bug Fixes
243
+
244
+ * deploy ([b035c26](https://github.com/snokam/components/commit/b035c26cc69d27c7890be4f9cd64f9c900cf4246))
245
+ * diff ([66a128a](https://github.com/snokam/components/commit/66a128a9ec73be500c0660ba4ac74e441b2aae61))
246
+ * export types ([f57b59d](https://github.com/snokam/components/commit/f57b59d21f4fb44dc56ace7b8c8ce622fba45ab0))
247
+ * reintroduce variable ([0e1698d](https://github.com/snokam/components/commit/0e1698d470ee1013569d5f4b11c55cc8bbec3450))
248
+ * remove comment ([cb774ca](https://github.com/snokam/components/commit/cb774caa0582c22088789bae44ef7e6631e117b6))
249
+ * remove export ([c56ad78](https://github.com/snokam/components/commit/c56ad786d74b64be2907c8ef627f17733ea44687))
250
+
251
+
252
+
253
+
254
+
255
+ ## [1.0.12](https://github.com/snokam/components/compare/@snokam/auth@1.0.11...@snokam/auth@1.0.12) (2024-08-28)
256
+
257
+
258
+ ### Bug Fixes
259
+
260
+ * expose server ([90202d5](https://github.com/snokam/components/commit/90202d506e391b75e6ce8aa338d38da2d1fb0548))
261
+
262
+
263
+
264
+
265
+
266
+ ## [1.0.11](https://github.com/snokam/components/compare/@snokam/auth@1.0.10...@snokam/auth@1.0.11) (2024-08-28)
267
+
268
+ **Note:** Version bump only for package @snokam/auth
269
+
270
+
271
+
272
+
273
+
274
+ ## [1.0.10](https://github.com/snokam/components/compare/@snokam/auth@1.0.9...@snokam/auth@1.0.10) (2024-08-28)
275
+
276
+ **Note:** Version bump only for package @snokam/auth
277
+
278
+
279
+
280
+
281
+
282
+ ## [1.0.9](https://github.com/snokam/components/compare/@snokam/auth@1.0.8...@snokam/auth@1.0.9) (2024-08-28)
283
+
284
+
285
+ ### Bug Fixes
286
+
287
+ * export authenticate on top level ([5ff50dc](https://github.com/snokam/components/commit/5ff50dc99cb11daeb34aecf37a86e5cae8ba5d62))
288
+
289
+
290
+
291
+
292
+
293
+ ## [1.0.8](https://github.com/snokam/components/compare/@snokam/auth@1.0.7...@snokam/auth@1.0.8) (2024-08-28)
294
+
295
+
296
+ ### Bug Fixes
297
+
298
+ * export authenticate ([7062de7](https://github.com/snokam/components/commit/7062de7a362d59863595ce38b9b5ec87b428ace4))
299
+
300
+
301
+
302
+
303
+
304
+ ## [1.0.7](https://github.com/snokam/components/compare/@snokam/auth@1.0.6...@snokam/auth@1.0.7) (2024-08-28)
305
+
306
+
307
+ ### Bug Fixes
308
+
309
+ * add dev deps ([28c56c7](https://github.com/snokam/components/commit/28c56c7973e290d0a5437fb4dd25cd35a8917379))
310
+
311
+
312
+
313
+
314
+
315
+ ## [1.0.6](https://github.com/snokam/components/compare/@snokam/auth@1.0.5...@snokam/auth@1.0.6) (2024-08-28)
316
+
317
+
318
+ ### Bug Fixes
319
+
320
+ * add server function ([dbeb3b7](https://github.com/snokam/components/commit/dbeb3b737830da3be3089b7e8a22a806bd6463e8))
321
+ * cleanup ([edf1e20](https://github.com/snokam/components/commit/edf1e2024c04412d01d4ca6f3547a35f8e1f2fb3))
322
+ * imports ([7e01e16](https://github.com/snokam/components/commit/7e01e16d84a40ff876ca9bd7c0ef001e57b3c148))
323
+ * save file ([e3cb96a](https://github.com/snokam/components/commit/e3cb96a8533e60bea5c27c97ecddc779908b6f49))
324
+
325
+
326
+
327
+
328
+
329
+ ## [1.0.5](https://github.com/snokam/components/compare/@snokam/auth@1.0.4...@snokam/auth@1.0.5) (2024-08-28)
330
+
331
+
332
+ ### Bug Fixes
333
+
334
+ * add callbackg ([6bbacc4](https://github.com/snokam/components/commit/6bbacc4eeb20aabec3c74bd165bde8761ef08c96))
335
+
336
+
337
+
338
+
339
+
340
+ ## [1.0.4](https://github.com/snokam/components/compare/@snokam/auth@1.0.3...@snokam/auth@1.0.4) (2024-08-28)
341
+
342
+
343
+ ### Bug Fixes
344
+
345
+ * remove useMemo ([b279bb4](https://github.com/snokam/components/commit/b279bb4e6de4657cd9c433908f0ba661f6cd4aac))
346
+
347
+
348
+
349
+
350
+
351
+ ## [1.0.3](https://github.com/snokam/components/compare/@snokam/auth@1.0.2...@snokam/auth@1.0.3) (2024-08-28)
352
+
353
+
354
+ ### Bug Fixes
355
+
356
+ * configg ([d04c85f](https://github.com/snokam/components/commit/d04c85f0865e51632cf08c63d2d1d77aebed73d2))
357
+
358
+
359
+
360
+
361
+
362
+ ## [1.0.2](https://github.com/snokam/components/compare/@snokam/auth@1.0.1...@snokam/auth@1.0.2) (2024-08-28)
363
+
364
+
365
+ ### Bug Fixes
366
+
367
+ * cleanup ([128a74e](https://github.com/snokam/components/commit/128a74e366f923cc3b2621c42ecbf8f23116be7d))
368
+
369
+
370
+
371
+
372
+
373
+ ## [1.0.1](https://github.com/snokam/components/compare/@snokam/auth@1.1.5...@snokam/auth@1.0.1) (2024-08-28)
374
+
375
+
376
+ ### Bug Fixes
377
+
378
+ * add snokam/auth ([ab21cc0](https://github.com/snokam/components/commit/ab21cc0ce9c5096ad144877e5288cfe34597c961))
@@ -0,0 +1,2 @@
1
+ import { Auth } from "../../types";
2
+ export declare const Authenticate: (props: Auth.Provider.Props) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const Callback: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Callback;
@@ -0,0 +1 @@
1
+ export declare const PopupLogin: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { Auth } from "../../types";
2
+ export declare const Provider: {
3
+ (props: Auth.Provider.Props): import("react/jsx-runtime").JSX.Element;
4
+ Callback: () => import("react/jsx-runtime").JSX.Element;
5
+ };
6
+ export default Provider;
@@ -0,0 +1,19 @@
1
+ export declare const config: {
2
+ auth: {
3
+ clientId: string;
4
+ authority: string;
5
+ postLogoutRedirectUri: string;
6
+ redirectUri: string;
7
+ navigateToLoginRequestUrl: boolean;
8
+ };
9
+ system: {
10
+ allowRedirectInIframe: boolean;
11
+ };
12
+ cache: {
13
+ storeAuthStateInCookie: boolean;
14
+ cacheLocation: string;
15
+ };
16
+ };
17
+ export declare const loginRequest: {
18
+ scopes: string[];
19
+ };
package/lib/hooks.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export declare const useAuth: () => {
2
+ getToken: (scopes?: string[]) => Promise<string>;
3
+ isAuthenticated: boolean;
4
+ inProgress: boolean;
5
+ instance: import("@azure/msal-browser").IPublicClientApplication;
6
+ account: import("@azure/msal-browser").AccountInfo;
7
+ };
package/lib/index.d.ts CHANGED
@@ -1,7 +1,11 @@
1
- import { AuthProps } from "./types";
2
- import { Configuration } from "./client";
3
- export type { AuthProps, Configuration };
4
- export declare const useClient: (props: AuthProps) => {
5
- configuration: Configuration;
6
- getToken: (scopes?: string[]) => Promise<any>;
1
+ import { Auth } from "./types";
2
+ export { useAuth } from "./hooks";
3
+ export type { Auth };
4
+ declare const _default: {
5
+ Provider: {
6
+ (props: Auth.Provider.Props): import("react/jsx-runtime").JSX.Element;
7
+ Callback: () => import("react/jsx-runtime").JSX.Element;
8
+ };
9
+ Authenticate: (props: Auth.Provider.Props) => import("react/jsx-runtime").JSX.Element;
7
10
  };
11
+ export default _default;
package/lib/index.js CHANGED
@@ -1,2 +1,10 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={689:(e,t,o)=>{o.d(t,{Configuration:()=>n.Configuration});const n=require("@snokam/employees-client")}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};o.r(n),o.d(n,{useClient:()=>c});const r=require("@azure/msal-react");var a=o(689);const c=e=>{const{basePath:t,withAuth:o}=e,{instance:n}=(0,r.useMsal)(),c=n.getAllAccounts()[0],i=e=>{return t=void 0,o=void 0,a=function*(){return n.acquireTokenSilent({scopes:e||[],account:c}).then((({accessToken:e})=>`Bearer ${e}`)).catch((e=>{throw console.error(e),e}))},new((r=void 0)||(r=Promise))((function(e,n){function c(e){try{s(a.next(e))}catch(e){n(e)}}function i(e){try{s(a.throw(e))}catch(e){n(e)}}function s(t){var o;t.done?e(t.value):(o=t.value,o instanceof r?o:new r((function(e){e(o)}))).then(c,i)}s((a=a.apply(t,o||[])).next())}));var t,o,r,a};return{configuration:new a.Configuration(Object.assign({basePath:t},o&&{accessToken:(e,t)=>i(t)})),getToken:i}};return n})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>T,useAuth:()=>g});const n=require("react/jsx-runtime"),r=require("@azure/msal-react"),o=require("@azure/msal-browser"),i=require("next/router"),s={auth:{clientId:`${process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID}`,authority:`https://login.microsoftonline.com/${process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID}/`,postLogoutRedirectUri:"/",redirectUri:"/callback",navigateToLoginRequestUrl:!1},system:{allowRedirectInIframe:!0},cache:{storeAuthStateInCookie:!0,cacheLocation:"localStorage"}},c={scopes:["openid"]},a="redirect",l=()=>{window.sessionStorage.setItem(a,window.location.pathname)},u=require("@snokam/core"),d=require("@mui/material"),p=require("react"),g=()=>{const{instance:e,inProgress:t}=(0,r.useMsal)(),n=e.getAllAccounts()[0];return{getToken:t=>e.acquireTokenSilent({scopes:t||[],account:n}).then((({accessToken:e})=>`Bearer ${e}`)),isAuthenticated:(0,r.useIsAuthenticated)(),inProgress:"startup"===t||"login"===t,instance:e,account:n}},m=require("@emotion/styled");var h=e.n(m);const f={Container:h().div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ align-items: center;
6
+ flex: 1;
7
+ `,Link:h().a`
8
+ text-decoration: "underline";
9
+ `},_=()=>{const{instance:e}=(0,r.useMsal)(),{account:t}=g(),[o,i]=(0,p.useState)();return o?(0,n.jsxs)(f.Container,{children:[(0,n.jsxs)("p",{children:["En feil oppstod: ",o.errorCode]}),(0,n.jsxs)("span",{children:["Prøv å gå direkte til ",(0,n.jsx)(f.Link,{target:"_blank",href:"https://skjer.snokam.no/?enforceLogin=true",rel:"noopener noreferrer",children:"skjer.snokam.no"}),"."]})]}):(0,n.jsxs)(f.Container,{children:["Du må logge inn på nytt for å vise siden",(0,n.jsx)(d.Button,{sx:{marginTop:"1rem"},onClick:()=>{l(),e.loginPopup(Object.assign(Object.assign(Object.assign({},c),t&&{account:t}),{redirectUri:"/blank.html"})).then((()=>i(void 0))).catch((e=>i(e)))},children:"Fortsett"})]})},j=e=>{const{children:t}=e,{query:s}=(0,i.useRouter)(),a=s.username,d=(null==s?void 0:s.enforceLogin)&&(null==s?void 0:s.username)?o.InteractionType.Silent:o.InteractionType.Redirect,p=Object.assign(Object.assign(Object.assign({},c),a&&{loginHint:a}),{onRedirectNavigate:e=>{l()}});return(0,n.jsx)(r.MsalAuthenticationTemplate,{interactionType:d,authenticationRequest:p,errorComponent:_,loadingComponent:()=>(0,n.jsx)(u.PageLoader,{color:"inherit"}),children:t})},b=new o.PublicClientApplication(s);b.initialize();const v=e=>{const{children:t,enforceLogin:o}=e,{query:s}=(0,i.useRouter)();if(!process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID)throw new Error("NEXT_PUBLIC_AZURE_AD_CLIENT_ID must be set in the environment variables");if(!process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID)throw new Error("NEXT_PUBLIC_AZURE_AD_TENANT_ID must be set in the environment variables");return s.enforceLogin||o?(0,n.jsx)(r.MsalProvider,{instance:b,children:(0,n.jsx)(j,Object.assign({},e,{children:t}))}):(0,n.jsx)(r.MsalProvider,{instance:b,children:t})};v.Callback=()=>{const e=(0,i.useRouter)();return(0,p.useEffect)((()=>{const t=window.sessionStorage.getItem(a);t?(window.sessionStorage.removeItem(a),console.log(`Redirecting to ${t} ...`),e.replace(t)):e.replace("/")}),[e]),(0,n.jsx)(u.PageLoader,{color:"inherit"})};const T={Provider:v,Authenticate:j};return t})()));
2
10
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,mFCTT,MAAM,EAA+BC,QAAQ,2B,GCCzCC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,CCrBAO,EAAoBK,EAAI,CAACZ,EAASa,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAEf,EAASc,IAC5EE,OAAOC,eAAejB,EAASc,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFd,EAAoBkB,EAAKzB,IACH,oBAAX0B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAejB,EAAS0B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAejB,EAAS,aAAc,CAAE4B,OAAO,GAAO,E,yCCL9D,MAAM,EAA+BvB,QAAQ,qB,aCWtC,MAAMwB,EAAaC,IACtB,MAAM,SAAEC,EAAQ,SAAEC,GAAaF,GACzB,SAAEG,IAAa,IAAAC,WACfC,EAAUF,EAASG,iBAAiB,GAEpCC,EAAYC,IAAWC,OAhBqBC,OAgBX,EAhBoBC,OAgBZ,EAhB2BC,EAgBX,YAC3D,OAAOT,EACFU,mBAAmB,CACpBL,OAAQA,GAAU,GAClBH,QAASA,IAERS,MAAK,EAAGC,iBAAkB,UAAUA,MACpCC,OAAOC,IAER,MADAC,QAAQD,MAAMA,GACRA,CAAK,GAEnB,EAzBO,KAFgEE,OAgBhB,KAdrCA,EAAIC,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAUzB,GAAS,IAAM0B,EAAKZ,EAAUa,KAAK3B,GAAS,CAAE,MAAO4B,GAAKJ,EAAOI,EAAI,CAAE,CAC1F,SAASC,EAAS7B,GAAS,IAAM0B,EAAKZ,EAAiB,MAAEd,GAAS,CAAE,MAAO4B,GAAKJ,EAAOI,EAAI,CAAE,CAC7F,SAASF,EAAKI,GAJlB,IAAe9B,EAIa8B,EAAOC,KAAOR,EAAQO,EAAO9B,QAJ1CA,EAIyD8B,EAAO9B,MAJhDA,aAAiBqB,EAAIrB,EAAQ,IAAIqB,GAAE,SAAUE,GAAWA,EAAQvB,EAAQ,KAIjBgB,KAAKS,EAAWI,EAAW,CAC7GH,GAAMZ,EAAYA,EAAUkB,MAAMpB,EAASC,GAAc,KAAKc,OAClE,IAPwC,IAAUf,EAASC,EAAYQ,EAAGP,CA2BxE,EAKF,MAAO,CACHmB,cAJkB,IAAI,EAAAC,cAAc9C,OAAO+C,OAAO,CAAEhC,YAAaC,GAAY,CAC7Ea,YAAa,CAACmB,EAAG1B,IAAWD,EAASC,MAIrCD,WACH,E","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/external commonjs \"@snokam/employees-client\"","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"@azure/msal-react\"","webpack://snokam/./src/index.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@snokam/employees-client\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@azure/msal-react\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { useMsal } from \"@azure/msal-react\";\nimport { Configuration } from \"./client\";\nexport const useClient = (props) => {\n const { basePath, withAuth } = props;\n const { instance } = useMsal();\n const account = instance.getAllAccounts()[0];\n // Fetch token from Azure Entra\n const getToken = (scopes) => __awaiter(void 0, void 0, void 0, function* () {\n return instance\n .acquireTokenSilent({\n scopes: scopes || [],\n account: account,\n })\n .then(({ accessToken }) => `Bearer ${accessToken}`)\n .catch((error) => {\n console.error(error);\n throw error;\n });\n });\n // Create configuration for Snøkam clients\n const configuration = new Configuration(Object.assign({ basePath }, (withAuth && {\n accessToken: (_, scopes) => getToken(scopes),\n })));\n return {\n configuration,\n getToken,\n };\n};\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","useClient","props","basePath","withAuth","instance","useMsal","account","getAllAccounts","getToken","scopes","__awaiter","thisArg","_arguments","generator","acquireTokenSilent","then","accessToken","catch","error","console","P","Promise","resolve","reject","fulfilled","step","next","e","rejected","result","done","apply","configuration","Configuration","assign","_"],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","mappings":"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","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/compat get default export","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"react/jsx-runtime\"","webpack://snokam/external commonjs \"@azure/msal-react\"","webpack://snokam/external commonjs \"@azure/msal-browser\"","webpack://snokam/external commonjs \"next/router\"","webpack://snokam/./src/config.ts","webpack://snokam/./src/storage.ts","webpack://snokam/external commonjs \"@snokam/core\"","webpack://snokam/external commonjs \"@mui/material\"","webpack://snokam/external commonjs \"react\"","webpack://snokam/./src/hooks.ts","webpack://snokam/external commonjs \"@emotion/styled\"","webpack://snokam/./src/components/Provider/styled.tsx","webpack://snokam/./src/components/Provider/Provider.PopupLogin.tsx","webpack://snokam/./src/components/Provider/Provider.Authenticate.tsx","webpack://snokam/./src/components/Provider/index.tsx","webpack://snokam/./src/components/Provider/Provider.Callback.tsx","webpack://snokam/./src/index.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react/jsx-runtime\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@azure/msal-react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@azure/msal-browser\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"next/router\");","export const config = {\n auth: {\n clientId: `${process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID}`,\n authority: `https://login.microsoftonline.com/${process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID}/`,\n postLogoutRedirectUri: \"/\",\n redirectUri: `/callback`,\n navigateToLoginRequestUrl: false,\n },\n system: {\n allowRedirectInIframe: true,\n },\n cache: {\n storeAuthStateInCookie: true,\n cacheLocation: \"localStorage\",\n },\n};\nexport const loginRequest = {\n scopes: [\"openid\"],\n};\n","const SessionStorageKey = \"redirect\";\nexport const storeCurrentPath = () => {\n window.sessionStorage.setItem(SessionStorageKey, window.location.pathname);\n};\nexport const getStoredPath = () => {\n return window.sessionStorage.getItem(SessionStorageKey);\n};\nexport const clearStoredPath = () => {\n window.sessionStorage.removeItem(SessionStorageKey);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@snokam/core\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","import { useIsAuthenticated, useMsal } from \"@azure/msal-react\";\nexport const useAuth = () => {\n const { instance, inProgress } = useMsal();\n const account = instance.getAllAccounts()[0];\n const isAuthenticated = useIsAuthenticated();\n const getToken = (scopes) => instance\n .acquireTokenSilent({\n scopes: scopes || [],\n account: account,\n })\n .then(({ accessToken }) => `Bearer ${accessToken}`);\n return {\n getToken,\n isAuthenticated,\n inProgress: inProgress === \"startup\" || inProgress === \"login\",\n instance,\n account,\n };\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@emotion/styled\");","import styled from \"@emotion/styled\";\nconst Container = styled.div `\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex: 1;\n`;\nconst Link = styled.a `\n text-decoration: \"underline\";\n`;\nexport default { Container, Link };\n","import { jsxs as _jsxs, jsx as _jsx } from \"react/jsx-runtime\";\nimport { useMsal } from \"@azure/msal-react\";\nimport { Button } from \"@mui/material\";\nimport { storeCurrentPath } from \"../../storage\";\nimport { useState } from \"react\";\nimport { useAuth } from \"../../hooks\";\nimport { loginRequest } from \"../../config\";\nimport Styled from \"./styled\";\nexport const PopupLogin = () => {\n const { instance } = useMsal();\n const { account } = useAuth();\n const [popupError, setPopupError] = useState();\n if (popupError) {\n return (_jsxs(Styled.Container, { children: [_jsxs(\"p\", { children: [\"En feil oppstod: \", popupError.errorCode] }), _jsxs(\"span\", { children: [`Prøv å gå direkte til `, _jsx(Styled.Link, { target: \"_blank\", href: \"https://skjer.snokam.no/?enforceLogin=true\", rel: \"noopener noreferrer\", children: \"skjer.snokam.no\" }), \".\"] })] }));\n }\n return (_jsxs(Styled.Container, { children: [\"Du m\\u00E5 logge inn p\\u00E5 nytt for \\u00E5 vise siden\", _jsx(Button, { sx: { marginTop: \"1rem\" }, onClick: () => {\n storeCurrentPath();\n instance\n .loginPopup(Object.assign(Object.assign(Object.assign({}, loginRequest), (account && {\n account,\n })), { redirectUri: \"/blank.html\" }))\n .then(() => setPopupError(undefined))\n .catch((error) => setPopupError(error));\n }, children: \"Fortsett\" })] }));\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { MsalAuthenticationTemplate } from \"@azure/msal-react\";\nimport { InteractionType } from \"@azure/msal-browser\";\nimport { storeCurrentPath } from \"../../storage\";\nimport { useRouter } from \"next/router\";\nimport { PageLoader } from \"@snokam/core\";\nimport { loginRequest } from \"../../config\";\nimport { PopupLogin } from \"./Provider.PopupLogin\";\nexport const Authenticate = (props) => {\n const { children } = props;\n const { query } = useRouter();\n const username = query.username;\n const interactionType = (query === null || query === void 0 ? void 0 : query.enforceLogin) && (query === null || query === void 0 ? void 0 : query.username)\n ? InteractionType.Silent\n : InteractionType.Redirect;\n const authRequest = Object.assign(Object.assign(Object.assign({}, loginRequest), (username && {\n loginHint: username,\n })), { onRedirectNavigate: (_) => {\n storeCurrentPath();\n } });\n const Loading = () => {\n return _jsx(PageLoader, { color: \"inherit\" });\n };\n return (_jsx(MsalAuthenticationTemplate, { interactionType: interactionType, authenticationRequest: authRequest, errorComponent: PopupLogin, loadingComponent: Loading, children: children }));\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { MsalProvider } from \"@azure/msal-react\";\nimport { PublicClientApplication } from \"@azure/msal-browser\";\nimport { useRouter } from \"next/router\";\nimport { config } from \"../../config\";\nimport { Authenticate } from \"./Provider.Authenticate\";\nimport Callback from \"./Provider.Callback\";\nconst msalInstance = new PublicClientApplication(config);\nmsalInstance.initialize();\nexport const Provider = (props) => {\n const { children, enforceLogin } = props;\n const { query } = useRouter();\n if (!process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID) {\n throw new Error(\"NEXT_PUBLIC_AZURE_AD_CLIENT_ID must be set in the environment variables\");\n }\n if (!process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID) {\n throw new Error(\"NEXT_PUBLIC_AZURE_AD_TENANT_ID must be set in the environment variables\");\n }\n if (query.enforceLogin || enforceLogin) {\n return (_jsx(MsalProvider, { instance: msalInstance, children: _jsx(Authenticate, Object.assign({}, props, { children: children })) }));\n }\n return _jsx(MsalProvider, { instance: msalInstance, children: children });\n};\nProvider.Callback = Callback;\nexport default Provider;\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { useEffect } from \"react\";\nimport { useRouter } from \"next/router\";\nimport { clearStoredPath, getStoredPath } from \"../../storage\";\nimport { PageLoader } from \"@snokam/core\";\nexport const Callback = () => {\n const router = useRouter();\n useEffect(() => {\n const redirectUrl = getStoredPath();\n if (redirectUrl) {\n clearStoredPath();\n console.log(`Redirecting to ${redirectUrl} ...`);\n router.replace(redirectUrl);\n }\n else {\n router.replace(\"/\");\n }\n }, [router]);\n return _jsx(PageLoader, { color: \"inherit\" });\n};\nexport default Callback;\n","import { Provider } from \"./components/Provider\";\nimport { Authenticate } from \"./components/Provider/Provider.Authenticate\";\nexport { useAuth } from \"./hooks\";\nexport default { Provider, Authenticate };\n// Trigger build\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","config","auth","clientId","process","env","NEXT_PUBLIC_AZURE_AD_CLIENT_ID","authority","NEXT_PUBLIC_AZURE_AD_TENANT_ID","postLogoutRedirectUri","redirectUri","navigateToLoginRequestUrl","system","allowRedirectInIframe","cache","storeAuthStateInCookie","cacheLocation","loginRequest","scopes","SessionStorageKey","storeCurrentPath","window","sessionStorage","setItem","location","pathname","useAuth","instance","inProgress","useMsal","account","getAllAccounts","getToken","acquireTokenSilent","then","accessToken","isAuthenticated","useIsAuthenticated","Container","Link","PopupLogin","popupError","setPopupError","useState","children","errorCode","target","href","rel","Button","sx","marginTop","onClick","loginPopup","assign","undefined","catch","error","Authenticate","props","query","useRouter","username","interactionType","enforceLogin","InteractionType","Silent","Redirect","authRequest","loginHint","onRedirectNavigate","_","MsalAuthenticationTemplate","authenticationRequest","errorComponent","loadingComponent","PageLoader","color","msalInstance","PublicClientApplication","initialize","Provider","Error","MsalProvider","Callback","router","useEffect","redirectUrl","getItem","removeItem","console","log","replace"],"sourceRoot":""}
@@ -0,0 +1 @@
1
+ export declare const getServerToken: (scopes: string[]) => Promise<string>;
package/lib/server.js ADDED
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.snokam=t():e.snokam=t()}(this,(()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{getServerToken:()=>o});const n=require("@azure/msal-node");const o=e=>{return t=void 0,o=void 0,i=function*(){if(!process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID)throw new Error("NEXT_PUBLIC_AZURE_AD_CLIENT_ID must be set in the environment variables");if(!process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID)throw new Error("NEXT_PUBLIC_AZURE_AD_TENANT_ID must be set in the environment variables");if(!process.env.AZURE_AD_SECRET)throw new Error("AZURE_AD_SECRET must be set in the environment variables");const t={auth:{clientId:`${process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID}`,authority:`https://login.microsoftonline.com/${process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID}/oauth2/v2.0`,clientSecret:`${process.env.AZURE_AD_SECRET}`}},o=new n.ConfidentialClientApplication(t),r=yield o.acquireTokenByClientCredential({scopes:e.map((e=>e.replace("user_impersonation",".default")))});return`Bearer ${null==r?void 0:r.accessToken}`},new((r=void 0)||(r=Promise))((function(e,n){function s(e){try{a(i.next(e))}catch(e){n(e)}}function c(e){try{a(i.throw(e))}catch(e){n(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,c)}a((i=i.apply(t,o||[])).next())}));var t,o,r,i};return t})()));
2
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,0CCL9D,MAAM,EAA+BC,QAAQ,oBCUtC,MAAMC,EAAkBC,IAAWC,OAVYC,OAUF,EAVWC,OAUH,EAVkBC,EAUF,YACxE,IAAKC,QAAQC,IAAIC,+BACb,MAAM,IAAIC,MAAM,2EAEpB,IAAKH,QAAQC,IAAIG,+BACb,MAAM,IAAID,MAAM,2EAEpB,IAAKH,QAAQC,IAAII,gBACb,MAAM,IAAIF,MAAM,4DAEpB,MAAMG,EAAS,CACXC,KAAM,CACFC,SAAU,GAAGR,QAAQC,IAAIC,iCACzBO,UAAW,qCAAqCT,QAAQC,IAAIG,6CAC5DM,aAAc,GAAGV,QAAQC,IAAII,oBAG/BM,EAAM,IAAI,EAAAC,8BAA8BN,GACxCO,QAAiBF,EAAIG,+BAA+B,CACtDnB,OAAQA,EAAOoB,KAAKC,GAAUA,EAAMC,QAAQ,qBAAsB,gBAEtE,MAAO,UAAUJ,aAA2C,EAASA,EAASK,aAClF,EA9BW,KAFgEC,OAUP,KAR9CA,EAAIC,WAAU,SAAUC,EAASC,GAC/C,SAASC,EAAU/B,GAAS,IAAMgC,EAAKzB,EAAU0B,KAAKjC,GAAS,CAAE,MAAOkC,GAAKJ,EAAOI,EAAI,CAAE,CAC1F,SAASC,EAASnC,GAAS,IAAMgC,EAAKzB,EAAiB,MAAEP,GAAS,CAAE,MAAOkC,GAAKJ,EAAOI,EAAI,CAAE,CAC7F,SAASF,EAAKI,GAJlB,IAAepC,EAIaoC,EAAOC,KAAOR,EAAQO,EAAOpC,QAJ1CA,EAIyDoC,EAAOpC,MAJhDA,aAAiB2B,EAAI3B,EAAQ,IAAI2B,GAAE,SAAUE,GAAWA,EAAQ7B,EAAQ,KAIjBsC,KAAKP,EAAWI,EAAW,CAC7GH,GAAMzB,EAAYA,EAAUgC,MAAMlC,EAASC,GAAc,KAAK2B,OAClE,IAPwC,IAAU5B,EAASC,EAAYqB,EAAGpB,CAgC5E,E","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"@azure/msal-node\"","webpack://snokam/./src/server.tsx"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@azure/msal-node\");","var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ConfidentialClientApplication } from \"@azure/msal-node\";\nexport const getServerToken = (scopes) => __awaiter(void 0, void 0, void 0, function* () {\n if (!process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID) {\n throw new Error(\"NEXT_PUBLIC_AZURE_AD_CLIENT_ID must be set in the environment variables\");\n }\n if (!process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID) {\n throw new Error(\"NEXT_PUBLIC_AZURE_AD_TENANT_ID must be set in the environment variables\");\n }\n if (!process.env.AZURE_AD_SECRET) {\n throw new Error(\"AZURE_AD_SECRET must be set in the environment variables\");\n }\n const config = {\n auth: {\n clientId: `${process.env.NEXT_PUBLIC_AZURE_AD_CLIENT_ID}`,\n authority: `https://login.microsoftonline.com/${process.env.NEXT_PUBLIC_AZURE_AD_TENANT_ID}/oauth2/v2.0`,\n clientSecret: `${process.env.AZURE_AD_SECRET}`,\n },\n };\n const cca = new ConfidentialClientApplication(config);\n const response = yield cca.acquireTokenByClientCredential({\n scopes: scopes.map((scope) => scope.replace(\"user_impersonation\", \".default\")),\n });\n return `Bearer ${response === null || response === void 0 ? void 0 : response.accessToken}`;\n});\n"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require","getServerToken","scopes","__awaiter","thisArg","_arguments","generator","process","env","NEXT_PUBLIC_AZURE_AD_CLIENT_ID","Error","NEXT_PUBLIC_AZURE_AD_TENANT_ID","AZURE_AD_SECRET","config","auth","clientId","authority","clientSecret","cca","ConfidentialClientApplication","response","acquireTokenByClientCredential","map","scope","replace","accessToken","P","Promise","resolve","reject","fulfilled","step","next","e","rejected","result","done","then","apply"],"sourceRoot":""}
@@ -0,0 +1,3 @@
1
+ export declare const storeCurrentPath: () => void;
2
+ export declare const getStoredPath: () => string;
3
+ export declare const clearStoredPath: () => void;
package/lib/types.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- export interface AuthProps {
2
- basePath: string;
3
- withAuth?: boolean;
1
+ import { ReactNode } from "react";
2
+ export declare namespace Auth {
3
+ namespace Provider {
4
+ interface Props {
5
+ children: ReactNode;
6
+ enforceLogin?: boolean;
7
+ }
8
+ }
4
9
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@snokam/auth",
3
- "description": "Utility functions for authentication",
4
- "version": "1.1.4",
3
+ "description": "Snøkam auth components",
4
+ "version": "2.0.0",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -15,17 +15,47 @@
15
15
  "directory": "@snokam/auth"
16
16
  },
17
17
  "scripts": {
18
- "start": "webpack --watch --config=../../webpack/webpack.dev.js",
19
- "build": "webpack --config=../../webpack/webpack.prod.js",
20
- "build:doc": "webpack --config=../../webpack/webpack.dev.js",
18
+ "start": "webpack --watch --config=../../../webpack/webpack.dev.js",
19
+ "build": "webpack --config=../../../webpack/webpack.prod.js",
20
+ "build:doc": "webpack --config=../../../webpack/webpack.dev.js",
21
21
  "clean": "rm -rf lib"
22
22
  },
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@azure/msal-react": "^2.0.21",
28
- "@snokam/employees-client": "^1.0.4"
27
+ "@azure/msal-browser": "^3.21.0",
28
+ "@azure/msal-node": "^2.13.0",
29
+ "@azure/msal-react": "^2.0.22",
30
+ "@emotion/react": "^11.13.0",
31
+ "@emotion/styled": "^11.13.0",
32
+ "@mui/material": "^6.0.2",
33
+ "@snokam/core": "^1.1.21"
29
34
  },
30
- "gitHead": "ceb2a9f36b1ca536e44862271831e9223defe97c"
35
+ "peerDependencies": {
36
+ "next": "^14.0.0",
37
+ "react": "^18.0.0",
38
+ "react-dom": "^18.0.0"
39
+ },
40
+ "exports": {
41
+ ".": {
42
+ "import": "./lib/index.js",
43
+ "types": "./lib/index.d.ts"
44
+ },
45
+ "./server": {
46
+ "import": "./lib/server.js",
47
+ "types": "./lib/server.d.ts"
48
+ }
49
+ },
50
+ "typesVersions": {
51
+ "*": {
52
+ "*": [
53
+ "lib/index.d.ts"
54
+ ],
55
+ "server": [
56
+ "lib/server.d.ts"
57
+ ]
58
+ }
59
+ },
60
+ "gitHead": "2270a4bce3735e01dd47178c6fd1550d63f8a83d"
31
61
  }
package/lib/client.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { Configuration } from "@snokam/employees-client";
2
- export { Configuration };
package/lib/client.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.snokam=o():e.snokam=o()}(this,(()=>(()=>{"use strict";var e={d:(o,t)=>{for(var r in t)e.o(t,r)&&!e.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:t[r]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{Configuration:()=>t.Configuration});const t=require("@snokam/employees-client");return o})()));
2
- //# sourceMappingURL=client.js.map
package/lib/client.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CCA1BA,EAAwB,CAACL,EAASM,KACjC,IAAI,IAAIC,KAAOD,EACXD,EAAoBG,EAAEF,EAAYC,KAASF,EAAoBG,EAAER,EAASO,IAC5EE,OAAOC,eAAeV,EAASO,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDF,EAAwB,CAACQ,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFT,EAAyBL,IACH,oBAAXkB,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeV,EAASkB,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeV,EAAS,aAAc,CAAEoB,OAAO,GAAO,G,uDCL9D,MAAM,EAA+BC,QAAQ,4B","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/define property getters","webpack://snokam/webpack/runtime/hasOwnProperty shorthand","webpack://snokam/webpack/runtime/make namespace object","webpack://snokam/external commonjs \"@snokam/employees-client\""],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@snokam/employees-client\");"],"names":["root","factory","exports","module","define","amd","this","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","require"],"sourceRoot":""}
package/lib/types.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.snokam=o():e.snokam=o()}(this,(()=>(()=>{"use strict";var e={};return(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e),e})()));
2
- //# sourceMappingURL=types.js.map
package/lib/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAgB,OAAID,IAEpBD,EAAa,OAAIC,GAClB,CATD,CASGK,MAAM,I,mBCRT,I,WCAwB,CAACJ,IACH,oBAAXK,QAA0BA,OAAOC,aAC1CC,OAAOC,eAAeR,EAASK,OAAOC,YAAa,CAAEG,MAAO,WAE7DF,OAAOC,eAAeR,EAAS,aAAc,CAAES,OAAO,GAAO,E","sources":["webpack://snokam/webpack/universalModuleDefinition","webpack://snokam/webpack/bootstrap","webpack://snokam/webpack/runtime/make namespace object"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"snokam\"] = factory();\n\telse\n\t\troot[\"snokam\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["root","factory","exports","module","define","amd","this","Symbol","toStringTag","Object","defineProperty","value"],"sourceRoot":""}