@fusionauth/angular-sdk 0.1.7 → 1.0.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,130 +1,333 @@
1
+ import { BehaviorSubject, Observable, catchError } from 'rxjs';
1
2
  import * as i0 from '@angular/core';
2
3
  import { Component, Input, NgModule } from '@angular/core';
3
4
 
5
+ // @ts-nocheck
6
+ const u = Object.defineProperty;
7
+ const d = (r, e, t) => e in r
8
+ ? u(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t })
9
+ : (r[e] = t);
10
+ const i = (r, e, t) => (d(r, typeof e != 'symbol' ? e + '' : e, t), t);
11
+ class g {
12
+ constructor(e) {
13
+ i(this, 'serverUrl');
14
+ i(this, 'clientId');
15
+ i(this, 'redirectUri');
16
+ i(this, 'scope');
17
+ i(this, 'mePath');
18
+ i(this, 'loginPath');
19
+ i(this, 'registerPath');
20
+ i(this, 'logoutPath');
21
+ i(this, 'tokenRefreshPath');
22
+ (this.serverUrl = e.serverUrl),
23
+ (this.clientId = e.clientId),
24
+ (this.redirectUri = e.redirectUri),
25
+ (this.scope = e.scope),
26
+ (this.mePath = e.mePath ?? '/app/me'),
27
+ (this.loginPath = e.loginPath ?? '/app/login'),
28
+ (this.registerPath = e.registerPath ?? '/app/register'),
29
+ (this.logoutPath = e.logoutPath ?? '/app/logout'),
30
+ (this.tokenRefreshPath = e.tokenRefreshPath ?? '/app/refresh');
31
+ }
32
+ getMeUrl() {
33
+ return this.generateUrl(this.mePath);
34
+ }
35
+ getLoginUrl(e) {
36
+ return this.generateUrl(this.loginPath, {
37
+ client_id: this.clientId,
38
+ redirect_uri: this.redirectUri,
39
+ scope: this.scope,
40
+ state: e,
41
+ });
42
+ }
43
+ getRegisterUrl(e) {
44
+ return this.generateUrl(this.registerPath, {
45
+ client_id: this.clientId,
46
+ redirect_uri: this.redirectUri,
47
+ scope: this.scope,
48
+ state: e,
49
+ });
50
+ }
51
+ getLogoutUrl() {
52
+ return this.generateUrl(this.logoutPath, {
53
+ client_id: this.clientId,
54
+ post_logout_redirect_uri: this.redirectUri,
55
+ });
56
+ }
57
+ getTokenRefreshUrl() {
58
+ return this.generateUrl(this.tokenRefreshPath, {
59
+ client_id: this.clientId,
60
+ });
61
+ }
62
+ generateUrl(e, t) {
63
+ const s = new URL(this.serverUrl);
64
+ if (((s.pathname = e), t)) {
65
+ const n = this.generateURLSearchParams(t);
66
+ s.search = n.toString();
67
+ }
68
+ return s;
69
+ }
70
+ generateURLSearchParams(e) {
71
+ const t = new URLSearchParams();
72
+ return (Object.entries(e).forEach(([s, n]) => {
73
+ n && t.append(s, n);
74
+ }),
75
+ t);
76
+ }
77
+ }
78
+ class o {
79
+ /**
80
+ * Parses document.cookie for the access token expiration cookie value.
81
+ * @returns {(number | null)} The moment of expiration in milliseconds since epoch.
82
+ */
83
+ static getAccessTokenExpirationMoment(e = 'app.at_exp') {
84
+ const t = document.cookie
85
+ .split('; ')
86
+ .map(n => n.split('='))
87
+ .find(([n]) => n === e), s = t == null ? void 0 : t[1];
88
+ return s ? parseInt(s) * 1e3 : null;
89
+ }
90
+ }
91
+ class p {
92
+ constructor(e) {
93
+ i(this, 'url');
94
+ this.url = e;
95
+ }
96
+ /** Refresh token a single time */
97
+ async refreshToken() {
98
+ const e = await fetch(this.url.href, {
99
+ method: 'POST',
100
+ credentials: 'include',
101
+ headers: {
102
+ 'Content-Type': 'text/plain',
103
+ },
104
+ });
105
+ if (!(e.status >= 200 && e.status < 300))
106
+ throw new Error('error refreshing access token in fusionauth');
107
+ }
108
+ /** Initializes continuous automatic token refresh. */
109
+ initAutoRefresh(e = 10, t) {
110
+ const s = o.getAccessTokenExpirationMoment(t);
111
+ if (!s)
112
+ return;
113
+ const n = e * 1e3, a = /* @__PURE__ */ new Date().getTime(), h = s - n, c = Math.max(h - a, 0);
114
+ return setTimeout(async () => {
115
+ try {
116
+ await this.refreshToken(), this.initAutoRefresh(e);
117
+ }
118
+ catch (l) {
119
+ console.error(l);
120
+ }
121
+ }, c);
122
+ }
123
+ }
124
+ class m {
125
+ /**
126
+ * Schedules a callback to be invoked at the given moment.
127
+ * @param expirationMoment - the access token expiration moment in milliseconds since the epoch.
128
+ * @param onExpiration - the callback to be invoked at the `expirationMoment`.
129
+ */
130
+ static scheduleTokenExpirationCallback(e, t) {
131
+ const s = /* @__PURE__ */ new Date().getTime(), n = e - s;
132
+ n > 0 && setTimeout(t, n);
133
+ }
134
+ }
135
+ class R {
136
+ constructor() {
137
+ i(this, 'REDIRECT_VALUE', 'fa-sdk-redirect-value');
138
+ }
139
+ handlePreRedirect(e) {
140
+ const t = `${this.generateRandomString()}:${e ?? ''}`;
141
+ localStorage.setItem(this.REDIRECT_VALUE, t);
142
+ }
143
+ handlePostRedirect(e) {
144
+ const t = this.stateValue ?? void 0;
145
+ e == null || e(t), localStorage.removeItem(this.REDIRECT_VALUE);
146
+ }
147
+ get didRedirect() {
148
+ return !!localStorage.getItem(this.REDIRECT_VALUE);
149
+ }
150
+ get stateValue() {
151
+ const e = localStorage.getItem(this.REDIRECT_VALUE);
152
+ if (!e)
153
+ return null;
154
+ const [, ...t] = e.split(':');
155
+ return t.join(':');
156
+ }
157
+ generateRandomString() {
158
+ const e = new Uint32Array(28);
159
+ return (window.crypto.getRandomValues(e),
160
+ Array.from(e, t => ('0' + t.toString(16)).substring(-2)).join(''));
161
+ }
162
+ }
163
+ class T {
164
+ constructor(e) {
165
+ i(this, 'config');
166
+ i(this, 'urlHelper');
167
+ i(this, 'tokenRefresher');
168
+ i(this, 'redirectHelper', new R());
169
+ (this.config = e),
170
+ (this.urlHelper = new g({
171
+ serverUrl: e.serverUrl,
172
+ clientId: e.clientId,
173
+ redirectUri: e.redirectUri,
174
+ scope: e.scope,
175
+ mePath: e.mePath,
176
+ loginPath: e.loginPath,
177
+ registerPath: e.registerPath,
178
+ logoutPath: e.logoutPath,
179
+ tokenRefreshPath: e.tokenRefreshPath,
180
+ })),
181
+ (this.tokenRefresher = new p(this.urlHelper.getTokenRefreshUrl())),
182
+ this.scheduleTokenExpirationEvent();
183
+ }
184
+ startLogin(e) {
185
+ this.redirectHelper.handlePreRedirect(e),
186
+ window.location.assign(this.urlHelper.getLoginUrl(e));
187
+ }
188
+ startRegister(e) {
189
+ this.redirectHelper.handlePreRedirect(e),
190
+ window.location.assign(this.urlHelper.getRegisterUrl(e));
191
+ }
192
+ startLogout() {
193
+ window.location.assign(this.urlHelper.getLogoutUrl());
194
+ }
195
+ async fetchUserInfo() {
196
+ const e = await fetch(this.urlHelper.getMeUrl(), {
197
+ credentials: 'include',
198
+ });
199
+ if (!e.ok)
200
+ throw new Error(`Unable to fetch userInfo in fusionauth. Request failed with status code ${e == null ? void 0 : e.status}`);
201
+ return await e.json();
202
+ }
203
+ async refreshToken() {
204
+ return await this.tokenRefresher.refreshToken();
205
+ }
206
+ initAutoRefresh() {
207
+ return this.tokenRefresher.initAutoRefresh(this.config.autoRefreshSecondsBeforeExpiry, this.config.accessTokenExpireCookieName);
208
+ }
209
+ handlePostRedirect(e) {
210
+ this.isLoggedIn &&
211
+ this.redirectHelper.didRedirect &&
212
+ this.redirectHelper.handlePostRedirect(e);
213
+ }
214
+ get isLoggedIn() {
215
+ return this.accessTokenExpirationMoment
216
+ ? this.accessTokenExpirationMoment > /* @__PURE__ */ new Date().getTime()
217
+ : !1;
218
+ }
219
+ get accessTokenExpirationMoment() {
220
+ return o.getAccessTokenExpirationMoment(this.config.accessTokenExpireCookieName);
221
+ }
222
+ scheduleTokenExpirationEvent() {
223
+ this.accessTokenExpirationMoment &&
224
+ this.config.onTokenExpiration &&
225
+ m.scheduleTokenExpirationCallback(this.accessTokenExpirationMoment, this.config.onTokenExpiration);
226
+ }
227
+ }
228
+ function U() {
229
+ const r = /* @__PURE__ */ new Date();
230
+ r.setHours(r.getHours() + 1);
231
+ const e = r.getTime() / 1e3;
232
+ document.cookie = `app.at_exp=${e}`;
233
+ }
234
+ function P() {
235
+ document.cookie = 'app.at_exp=;expires=Thu, 01 Jan 1970 00:00:00 GMT';
236
+ }
237
+ function E(r) {
238
+ const e = {
239
+ ...window.location,
240
+ assign: r.fn(),
241
+ };
242
+ return r.spyOn(window, 'location', 'get').mockReturnValue(e), e;
243
+ }
244
+
4
245
  /**
5
246
  * Service class to use with FusionAuth backend endpoints.
6
247
  */
7
248
  class FusionAuthService {
8
249
  constructor(config) {
9
- this.config = config;
250
+ this.core = new T({
251
+ ...config,
252
+ onTokenExpiration: () => {
253
+ this.isLoggedInSubject.next(false);
254
+ },
255
+ });
256
+ this.isLoggedInSubject = new BehaviorSubject(this.core.isLoggedIn);
257
+ this.isLoggedIn$ = this.isLoggedInSubject.asObservable();
258
+ this.core.handlePostRedirect(config.onRedirect);
259
+ if (config.shouldAutoRefresh && this.core.isLoggedIn) {
260
+ this.initAutoRefresh();
261
+ }
262
+ }
263
+ /** A function that returns whether the user is logged in. This returned value is non-observable. */
264
+ isLoggedIn() {
265
+ return this.core.isLoggedIn;
10
266
  }
11
267
  /**
12
- * Calls the 'me' endpoint to retrieve user info.
13
- * @return {Promise<UserInfo>} the user info response.
268
+ * Refreshes the access token a single time.
269
+ * Automatic token refreshing can be enabled if the SDK is configured with `shouldAutoRefresh`.
14
270
  */
15
- async getUserInfo() {
16
- const path = this.config.mePath ? this.config.mePath : '/app/me';
17
- const uri = this.getUrlForPath(path);
18
- const resp = await fetch(uri.href, {
19
- credentials: 'include',
20
- });
21
- return JSON.parse(await resp.text());
271
+ async refreshToken() {
272
+ return await this.core.refreshToken();
22
273
  }
23
274
  /**
24
- * Checks for the 'app.at_exp' cookie and if present sets a timer to refresh the access token.
25
- * Will attempt to refresh the configured seconds before the access token expires (default is ten seconds).
275
+ * Initializes automatic access token refreshing.
276
+ * This is handled automatically if the SDK is configured with `shouldAutoRefresh`.
26
277
  */
27
278
  initAutoRefresh() {
28
- const exp = this.getExpTime();
29
- if (exp) {
30
- const refreshBeforeSeconds = this.config.autoRefreshSecondsBeforeExpiry
31
- ? this.config.autoRefreshSecondsBeforeExpiry
32
- : 10;
33
- const now = new Date().getTime();
34
- const refreshTime = exp - refreshBeforeSeconds * 1000;
35
- let timeTillThen = refreshTime - now;
36
- if (timeTillThen <= 0) {
37
- timeTillThen = 0;
38
- }
39
- setTimeout(async () => {
40
- try {
41
- await this.refreshToken();
42
- this.initAutoRefresh();
43
- }
44
- catch (e) {
45
- console.error(e);
46
- }
47
- }, timeTillThen);
279
+ if (this.autoRefreshTimer) {
280
+ clearTimeout(this.autoRefreshTimer);
48
281
  }
282
+ this.autoRefreshTimer = this.core.initAutoRefresh();
49
283
  }
50
284
  /**
51
- * Checks that the 'app.at_exp' cookie is present and for a time in the future to determine logged-in state.
52
- * @return {boolean} app.at_exp is present and not for a time in the past
285
+ * Returns an observable request that fetches userInfo, and catches error.
53
286
  */
54
- isLoggedIn() {
55
- return (this.getExpTime() ?? 0) > new Date().getTime();
287
+ getUserInfoObservable(callbacks) {
288
+ callbacks?.onBegin?.();
289
+ return new Observable(observer => {
290
+ this.core
291
+ .fetchUserInfo()
292
+ .then(userInfo => {
293
+ observer.next(userInfo);
294
+ })
295
+ .catch(error => {
296
+ observer.error(error);
297
+ })
298
+ .finally(() => {
299
+ callbacks?.onDone?.();
300
+ });
301
+ }).pipe(catchError(error => {
302
+ throw error;
303
+ }));
56
304
  }
57
305
  /**
58
- * Calls the configured 'refresh' endpoint to attempt to refresh the access token cookie.
306
+ * Fetches userInfo from the 'me' endpoint.
307
+ * @throws {Error} - if an error occurred while fetching.
59
308
  */
60
- async refreshToken() {
61
- const path = this.config.tokenRefreshPath
62
- ? `${this.config.tokenRefreshPath}/${this.config.clientId}`
63
- : `/app/refresh/${this.config.clientId}`;
64
- const uri = this.getUrlForPath(path);
65
- const resp = await fetch(uri.href, {
66
- method: 'POST',
67
- credentials: 'include',
68
- headers: {
69
- 'Content-Type': 'text/plain',
70
- },
71
- });
72
- if (!(resp.status >= 200 && resp.status < 300)) {
73
- throw new Error('error refreshing access token in fusionauth');
74
- }
309
+ async getUserInfo() {
310
+ return await this.core.fetchUserInfo();
75
311
  }
76
312
  /**
77
- * Invokes a redirect to the configured 'login' endpoint.
313
+ * Initiates login flow.
314
+ * @param {string} [state] - Optional value to be echoed back to the SDK upon redirect.
78
315
  */
79
316
  startLogin(state) {
80
- const path = this.config.loginPath ? this.config.loginPath : '/app/login';
81
- state
82
- ? this.doRedirectForPath(path, { state })
83
- : this.doRedirectForPath(path);
317
+ this.core.startLogin(state);
84
318
  }
85
319
  /**
86
- * Invokes a redirect to the configured 'refresh' endpoint.
320
+ * Initiates register flow.
321
+ * @param {string} [state] - Optional value to be echoed back to the SDK upon redirect.
87
322
  */
88
323
  startRegistration(state) {
89
- const path = this.config.registerPath
90
- ? this.config.registerPath
91
- : '/app/register';
92
- state
93
- ? this.doRedirectForPath(path, { state })
94
- : this.doRedirectForPath(path);
324
+ this.core.startRegister(state);
95
325
  }
96
326
  /**
97
- * Invokes a redirect to the configured 'logout' endpoint.
327
+ * Initiates logout flow.
98
328
  */
99
329
  logout() {
100
- const path = this.config.logoutPath
101
- ? this.config.logoutPath
102
- : '/app/logout';
103
- this.doRedirectForPath(path);
104
- }
105
- doRedirectForPath(path, params = {}) {
106
- path = path + `/${this.config.clientId}`;
107
- if (this.config.redirectUri) {
108
- params['redirect_uri'] = this.config.redirectUri;
109
- }
110
- const location = this.getUrlForPath(path, params);
111
- window.location.assign(location);
112
- }
113
- getUrlForPath(path, params = {}) {
114
- const url = new URL(this.config.serverUrl);
115
- url.pathname = path;
116
- if (Object.entries(params).length > 0) {
117
- const urlParams = new URLSearchParams(params);
118
- url.search = urlParams.toString();
119
- }
120
- return url;
121
- }
122
- getExpTime() {
123
- const expCookie = document.cookie
124
- .split('; ')
125
- .map(c => c.split('='))
126
- .find(([name]) => name === 'app.at_exp');
127
- return expCookie ? parseInt(expCookie?.[1] ?? '0') * 1000 : null;
330
+ this.core.startLogout();
128
331
  }
129
332
  }
130
333
 
@@ -135,10 +338,10 @@ class FusionAuthLoginButtonComponent {
135
338
  login() {
136
339
  this.fusionAuth.startLogin(this.state);
137
340
  }
138
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthLoginButtonComponent, deps: [{ token: FusionAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
139
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: FusionAuthLoginButtonComponent, selector: "fa-login", inputs: { state: "state" }, ngImport: i0, template: "<button class=\"fa-button\" (click)=\"login()\">\n <span>Login</span>\n</button>\n", styles: [".fa-button{padding:16px 16px 13px;border-radius:8px;background-color:#083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:18px;font-weight:600;text-align:center;color:#fff;width:400px}.fa-button:hover{cursor:pointer}\n"] }); }
341
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthLoginButtonComponent, deps: [{ token: FusionAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
342
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: FusionAuthLoginButtonComponent, selector: "fa-login", inputs: { state: "state" }, ngImport: i0, template: "<button class=\"fa-button\" (click)=\"login()\">\n <span>Login</span>\n</button>\n", styles: [".fa-button{padding:16px 16px 13px;border-radius:8px;background-color:#083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:18px;font-weight:600;text-align:center;color:#fff;width:400px}.fa-button:hover{cursor:pointer}\n"] }); }
140
343
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthLoginButtonComponent, decorators: [{
344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthLoginButtonComponent, decorators: [{
142
345
  type: Component,
143
346
  args: [{ selector: 'fa-login', template: "<button class=\"fa-button\" (click)=\"login()\">\n <span>Login</span>\n</button>\n", styles: [".fa-button{padding:16px 16px 13px;border-radius:8px;background-color:#083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:18px;font-weight:600;text-align:center;color:#fff;width:400px}.fa-button:hover{cursor:pointer}\n"] }]
144
347
  }], ctorParameters: () => [{ type: FusionAuthService }], propDecorators: { state: [{
@@ -152,10 +355,10 @@ class FusionAuthLogoutButtonComponent {
152
355
  logout() {
153
356
  this.fusionAuth.logout();
154
357
  }
155
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthLogoutButtonComponent, deps: [{ token: FusionAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
156
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: FusionAuthLogoutButtonComponent, selector: "fa-logout", ngImport: i0, template: "<button class=\"fa-logout-button\" (click)=\"logout()\">\n <span>logout</span>\n</button>\n", styles: [".fa-logout-button{padding:7px 13px;border-radius:3px;display:block;border:solid 1px #083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:12px;text-align:center;color:#083b94}.fa-logout-button:hover{cursor:pointer}\n"] }); }
358
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthLogoutButtonComponent, deps: [{ token: FusionAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
359
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: FusionAuthLogoutButtonComponent, selector: "fa-logout", ngImport: i0, template: "<button class=\"fa-logout-button\" (click)=\"logout()\">\n <span>logout</span>\n</button>\n", styles: [".fa-logout-button{padding:7px 13px;border-radius:3px;display:block;border:solid 1px #083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:12px;text-align:center;color:#083b94}.fa-logout-button:hover{cursor:pointer}\n"] }); }
157
360
  }
158
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthLogoutButtonComponent, decorators: [{
361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthLogoutButtonComponent, decorators: [{
159
362
  type: Component,
160
363
  args: [{ selector: 'fa-logout', template: "<button class=\"fa-logout-button\" (click)=\"logout()\">\n <span>logout</span>\n</button>\n", styles: [".fa-logout-button{padding:7px 13px;border-radius:3px;display:block;border:solid 1px #083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:12px;text-align:center;color:#083b94}.fa-logout-button:hover{cursor:pointer}\n"] }]
161
364
  }], ctorParameters: () => [{ type: FusionAuthService }] });
@@ -167,10 +370,10 @@ class FusionAuthRegisterButtonComponent {
167
370
  register() {
168
371
  this.fusionAuth.startRegistration(this.state);
169
372
  }
170
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthRegisterButtonComponent, deps: [{ token: FusionAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
171
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: FusionAuthRegisterButtonComponent, selector: "fa-register", inputs: { state: "state" }, ngImport: i0, template: "<button class=\"fa-button\" (click)=\"register()\">\n <span>Register Now</span>\n</button>\n", styles: [".fa-button{padding:16px 16px 13px;border-radius:8px;background-color:#083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:18px;font-weight:600;text-align:center;color:#fff;width:400px}.fa-button:hover{cursor:pointer}\n"] }); }
373
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthRegisterButtonComponent, deps: [{ token: FusionAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
374
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: FusionAuthRegisterButtonComponent, selector: "fa-register", inputs: { state: "state" }, ngImport: i0, template: "<button class=\"fa-button\" (click)=\"register()\">\n <span>Register Now</span>\n</button>\n", styles: [".fa-button{padding:16px 16px 13px;border-radius:8px;background-color:#083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:18px;font-weight:600;text-align:center;color:#fff;width:400px}.fa-button:hover{cursor:pointer}\n"] }); }
172
375
  }
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthRegisterButtonComponent, decorators: [{
376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthRegisterButtonComponent, decorators: [{
174
377
  type: Component,
175
378
  args: [{ selector: 'fa-register', template: "<button class=\"fa-button\" (click)=\"register()\">\n <span>Register Now</span>\n</button>\n", styles: [".fa-button{padding:16px 16px 13px;border-radius:8px;background-color:#083b94;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",Segoe UI Symbol;font-size:18px;font-weight:600;text-align:center;color:#fff;width:400px}.fa-button:hover{cursor:pointer}\n"] }]
176
379
  }], ctorParameters: () => [{ type: FusionAuthService }], propDecorators: { state: [{
@@ -189,15 +392,15 @@ class FusionAuthModule {
189
392
  ],
190
393
  };
191
394
  }
192
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
193
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthModule, declarations: [FusionAuthLoginButtonComponent,
395
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
396
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthModule, declarations: [FusionAuthLoginButtonComponent,
194
397
  FusionAuthLogoutButtonComponent,
195
398
  FusionAuthRegisterButtonComponent], exports: [FusionAuthLoginButtonComponent,
196
399
  FusionAuthLogoutButtonComponent,
197
400
  FusionAuthRegisterButtonComponent] }); }
198
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthModule }); }
401
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthModule }); }
199
402
  }
200
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: FusionAuthModule, decorators: [{
403
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: FusionAuthModule, decorators: [{
201
404
  type: NgModule,
202
405
  args: [{
203
406
  declarations: [
@@ -1 +1 @@
1
- {"version":3,"file":"fusionauth-angular-sdk.mjs","sources":["../../../projects/fusionauth-angular-sdk/src/lib/fusion-auth.service.ts","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-login.button/fusion-auth-login-button.component.ts","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-login.button/fusion-auth-login-button.component.html","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-logout.button/fusion-auth-logout-button.component.ts","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-logout.button/fusion-auth-logout-button.component.html","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-register.button/fusion-auth-register-button.component.ts","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-register.button/fusion-auth-register-button.component.html","../../../projects/fusionauth-angular-sdk/src/lib/fusion-auth.module.ts","../../../projects/fusionauth-angular-sdk/src/public-api.ts","../../../projects/fusionauth-angular-sdk/src/fusionauth-angular-sdk.ts"],"sourcesContent":["import { FusionAuthConfig, UserInfo } from './types';\n\n/**\n * Service class to use with FusionAuth backend endpoints.\n */\nexport class FusionAuthService {\n constructor(private config: FusionAuthConfig) {}\n\n /**\n * Calls the 'me' endpoint to retrieve user info.\n * @return {Promise<UserInfo>} the user info response.\n */\n async getUserInfo(): Promise<UserInfo> {\n const path = this.config.mePath ? this.config.mePath : '/app/me';\n const uri = this.getUrlForPath(path);\n const resp = await fetch(uri.href, {\n credentials: 'include',\n });\n return JSON.parse(await resp.text()) as UserInfo;\n }\n\n /**\n * Checks for the 'app.at_exp' cookie and if present sets a timer to refresh the access token.\n * Will attempt to refresh the configured seconds before the access token expires (default is ten seconds).\n */\n initAutoRefresh(): void {\n const exp = this.getExpTime();\n if (exp) {\n const refreshBeforeSeconds = this.config.autoRefreshSecondsBeforeExpiry\n ? this.config.autoRefreshSecondsBeforeExpiry\n : 10;\n const now = new Date().getTime();\n const refreshTime = exp - refreshBeforeSeconds * 1000;\n let timeTillThen = refreshTime - now;\n if (timeTillThen <= 0) {\n timeTillThen = 0;\n }\n setTimeout(async () => {\n try {\n await this.refreshToken();\n this.initAutoRefresh();\n } catch (e) {\n console.error(e);\n }\n }, timeTillThen);\n }\n }\n\n /**\n * Checks that the 'app.at_exp' cookie is present and for a time in the future to determine logged-in state.\n * @return {boolean} app.at_exp is present and not for a time in the past\n */\n isLoggedIn(): boolean {\n return (this.getExpTime() ?? 0) > new Date().getTime();\n }\n\n /**\n * Calls the configured 'refresh' endpoint to attempt to refresh the access token cookie.\n */\n async refreshToken(): Promise<void> {\n const path = this.config.tokenRefreshPath\n ? `${this.config.tokenRefreshPath}/${this.config.clientId}`\n : `/app/refresh/${this.config.clientId}`;\n const uri = this.getUrlForPath(path);\n const resp = await fetch(uri.href, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'text/plain',\n },\n });\n if (!(resp.status >= 200 && resp.status < 300)) {\n throw new Error('error refreshing access token in fusionauth');\n }\n }\n\n /**\n * Invokes a redirect to the configured 'login' endpoint.\n */\n startLogin(state?: string): void {\n const path = this.config.loginPath ? this.config.loginPath : '/app/login';\n state\n ? this.doRedirectForPath(path, { state })\n : this.doRedirectForPath(path);\n }\n\n /**\n * Invokes a redirect to the configured 'refresh' endpoint.\n */\n startRegistration(state?: string): void {\n const path = this.config.registerPath\n ? this.config.registerPath\n : '/app/register';\n state\n ? this.doRedirectForPath(path, { state })\n : this.doRedirectForPath(path);\n }\n\n /**\n * Invokes a redirect to the configured 'logout' endpoint.\n */\n logout(): void {\n const path = this.config.logoutPath\n ? this.config.logoutPath\n : '/app/logout';\n this.doRedirectForPath(path);\n }\n\n private doRedirectForPath(path: string, params: Record<string, any> = {}) {\n path = path + `/${this.config.clientId}`;\n if (this.config.redirectUri) {\n params['redirect_uri'] = this.config.redirectUri;\n }\n const location = this.getUrlForPath(path, params);\n window.location.assign(location);\n }\n\n private getUrlForPath(path: string, params: Record<string, any> = {}): URL {\n const url = new URL(this.config.serverUrl);\n url.pathname = path;\n if (Object.entries(params).length > 0) {\n const urlParams = new URLSearchParams(params);\n url.search = urlParams.toString();\n }\n return url;\n }\n\n private getExpTime(): number | null {\n const expCookie = document.cookie\n .split('; ')\n .map(c => c.split('='))\n .find(([name]) => name === 'app.at_exp');\n return expCookie ? parseInt(expCookie?.[1] ?? '0') * 1000 : null;\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { FusionAuthService } from '../../fusion-auth.service';\n\n@Component({\n selector: 'fa-login',\n templateUrl: './fusion-auth-login-button.component.html',\n styleUrls: ['./fusion-auth-login-button.component.scss'],\n})\nexport class FusionAuthLoginButtonComponent {\n @Input() state: string | undefined;\n\n constructor(private fusionAuth: FusionAuthService) {}\n\n login() {\n this.fusionAuth.startLogin(this.state);\n }\n}\n","<button class=\"fa-button\" (click)=\"login()\">\n <span>Login</span>\n</button>\n","import { Component } from '@angular/core';\nimport { FusionAuthService } from '../../fusion-auth.service';\n\n@Component({\n selector: 'fa-logout',\n templateUrl: './fusion-auth-logout-button.component.html',\n styleUrls: ['./fusion-auth-logout-button.component.scss'],\n})\nexport class FusionAuthLogoutButtonComponent {\n constructor(private fusionAuth: FusionAuthService) {}\n\n logout() {\n this.fusionAuth.logout();\n }\n}\n","<button class=\"fa-logout-button\" (click)=\"logout()\">\n <span>logout</span>\n</button>\n","import { Component, Input } from '@angular/core';\nimport { FusionAuthService } from '../../fusion-auth.service';\n\n@Component({\n selector: 'fa-register',\n templateUrl: './fusion-auth-register-button.component.html',\n styleUrls: ['./fusion-auth-register-button.component.scss'],\n})\nexport class FusionAuthRegisterButtonComponent {\n @Input() state: string | undefined;\n\n constructor(private fusionAuth: FusionAuthService) {}\n\n register() {\n this.fusionAuth.startRegistration(this.state);\n }\n}\n","<button class=\"fa-button\" (click)=\"register()\">\n <span>Register Now</span>\n</button>\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FusionAuthConfig } from './types';\nimport { FusionAuthService } from './fusion-auth.service';\nimport { FusionAuthLoginButtonComponent } from './components/fusionauth-login.button/fusion-auth-login-button.component';\nimport { FusionAuthLogoutButtonComponent } from './components/fusionauth-logout.button/fusion-auth-logout-button.component';\nimport { FusionAuthRegisterButtonComponent } from './components/fusionauth-register.button/fusion-auth-register-button.component';\n\n@NgModule({\n declarations: [\n FusionAuthLoginButtonComponent,\n FusionAuthLogoutButtonComponent,\n FusionAuthRegisterButtonComponent,\n ],\n imports: [],\n exports: [\n FusionAuthLoginButtonComponent,\n FusionAuthLogoutButtonComponent,\n FusionAuthRegisterButtonComponent,\n ],\n})\nexport class FusionAuthModule {\n static forRoot(\n fusionAuthConfig: FusionAuthConfig,\n ): ModuleWithProviders<FusionAuthModule> {\n return {\n ngModule: FusionAuthModule,\n providers: [\n {\n provide: FusionAuthService,\n useValue: new FusionAuthService(fusionAuthConfig),\n },\n ],\n };\n }\n}\n","/*\n * Public API Surface of fusionauth-angular-sdk\n */\n\nexport * from './lib/fusion-auth.service';\nexport * from './lib/components/fusionauth-login.button/fusion-auth-login-button.component';\nexport * from './lib/components/fusionauth-logout.button/fusion-auth-logout-button.component';\nexport * from './lib/components/fusionauth-register.button/fusion-auth-register-button.component';\nexport * from './lib/fusion-auth.module';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.FusionAuthService"],"mappings":";;;AAEA;;AAEG;MACU,iBAAiB,CAAA;AAC5B,IAAA,WAAA,CAAoB,MAAwB,EAAA;QAAxB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAkB;KAAI;AAEhD;;;AAGG;AACH,IAAA,MAAM,WAAW,GAAA;AACf,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC;QACjE,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,IAAI,EA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,CACZ,gBAAkC,EAAA;QAElC,OAAO;AACL,YAAA,QAAQ,EAAE,gBAAgB;AAC1B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,QAAQ,EAAE,IAAI,iBAAiB,CAAC,gBAAgB,CAAC;AAClD,iBAAA;AACF,aAAA;SACF,CAAC;KACH;8GAbU,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,iBAXzB,8BAA8B;YAC9B,+BAA+B;AAC/B,YAAA,iCAAiC,aAIjC,8BAA8B;YAC9B,+BAA+B;YAC/B,iCAAiC,CAAA,EAAA,CAAA,CAAA,EAAA;+GAGxB,gBAAgB,EAAA,CAAA,CAAA,EAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,8BAA8B;wBAC9B,+BAA+B;wBAC/B,iCAAiC;AAClC,qBAAA;AACD,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE;wBACP,8BAA8B;wBAC9B,+BAA+B;wBAC/B,iCAAiC;AAClC,qBAAA;AACF,iBAAA,CAAA;;;ACnBD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"fusionauth-angular-sdk.mjs","sources":["../../../projects/fusionauth-angular-sdk/src/lib/core.ts","../../../projects/fusionauth-angular-sdk/src/lib/fusion-auth.service.ts","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-login.button/fusion-auth-login-button.component.ts","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-login.button/fusion-auth-login-button.component.html","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-logout.button/fusion-auth-logout-button.component.ts","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-logout.button/fusion-auth-logout-button.component.html","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-register.button/fusion-auth-register-button.component.ts","../../../projects/fusionauth-angular-sdk/src/lib/components/fusionauth-register.button/fusion-auth-register-button.component.html","../../../projects/fusionauth-angular-sdk/src/lib/fusion-auth.module.ts","../../../projects/fusionauth-angular-sdk/src/public-api.ts","../../../projects/fusionauth-angular-sdk/src/fusionauth-angular-sdk.ts"],"sourcesContent":["// @ts-nocheck\nconst u = Object.defineProperty;\nconst d = (r, e, t) =>\n e in r\n ? u(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t })\n : (r[e] = t);\nconst i = (r, e, t) => (d(r, typeof e != 'symbol' ? e + '' : e, t), t);\nclass g {\n constructor(e) {\n i(this, 'serverUrl');\n i(this, 'clientId');\n i(this, 'redirectUri');\n i(this, 'scope');\n i(this, 'mePath');\n i(this, 'loginPath');\n i(this, 'registerPath');\n i(this, 'logoutPath');\n i(this, 'tokenRefreshPath');\n (this.serverUrl = e.serverUrl),\n (this.clientId = e.clientId),\n (this.redirectUri = e.redirectUri),\n (this.scope = e.scope),\n (this.mePath = e.mePath ?? '/app/me'),\n (this.loginPath = e.loginPath ?? '/app/login'),\n (this.registerPath = e.registerPath ?? '/app/register'),\n (this.logoutPath = e.logoutPath ?? '/app/logout'),\n (this.tokenRefreshPath = e.tokenRefreshPath ?? '/app/refresh');\n }\n getMeUrl() {\n return this.generateUrl(this.mePath);\n }\n getLoginUrl(e) {\n return this.generateUrl(this.loginPath, {\n client_id: this.clientId,\n redirect_uri: this.redirectUri,\n scope: this.scope,\n state: e,\n });\n }\n getRegisterUrl(e) {\n return this.generateUrl(this.registerPath, {\n client_id: this.clientId,\n redirect_uri: this.redirectUri,\n scope: this.scope,\n state: e,\n });\n }\n getLogoutUrl() {\n return this.generateUrl(this.logoutPath, {\n client_id: this.clientId,\n post_logout_redirect_uri: this.redirectUri,\n });\n }\n getTokenRefreshUrl() {\n return this.generateUrl(this.tokenRefreshPath, {\n client_id: this.clientId,\n });\n }\n generateUrl(e, t) {\n const s = new URL(this.serverUrl);\n if (((s.pathname = e), t)) {\n const n = this.generateURLSearchParams(t);\n s.search = n.toString();\n }\n return s;\n }\n generateURLSearchParams(e) {\n const t = new URLSearchParams();\n return (\n Object.entries(e).forEach(([s, n]) => {\n n && t.append(s, n);\n }),\n t\n );\n }\n}\nclass o {\n /**\n * Parses document.cookie for the access token expiration cookie value.\n * @returns {(number | null)} The moment of expiration in milliseconds since epoch.\n */\n static getAccessTokenExpirationMoment(e = 'app.at_exp') {\n const t = document.cookie\n .split('; ')\n .map(n => n.split('='))\n .find(([n]) => n === e),\n s = t == null ? void 0 : t[1];\n return s ? parseInt(s) * 1e3 : null;\n }\n}\nclass p {\n constructor(e) {\n i(this, 'url');\n this.url = e;\n }\n /** Refresh token a single time */\n async refreshToken() {\n const e = await fetch(this.url.href, {\n method: 'POST',\n credentials: 'include',\n headers: {\n 'Content-Type': 'text/plain',\n },\n });\n if (!(e.status >= 200 && e.status < 300))\n throw new Error('error refreshing access token in fusionauth');\n }\n /** Initializes continuous automatic token refresh. */\n initAutoRefresh(e = 10, t) {\n const s = o.getAccessTokenExpirationMoment(t);\n if (!s) return;\n const n = e * 1e3,\n a = /* @__PURE__ */ new Date().getTime(),\n h = s - n,\n c = Math.max(h - a, 0);\n return setTimeout(async () => {\n try {\n await this.refreshToken(), this.initAutoRefresh(e);\n } catch (l) {\n console.error(l);\n }\n }, c);\n }\n}\nclass m {\n /**\n * Schedules a callback to be invoked at the given moment.\n * @param expirationMoment - the access token expiration moment in milliseconds since the epoch.\n * @param onExpiration - the callback to be invoked at the `expirationMoment`.\n */\n static scheduleTokenExpirationCallback(e, t) {\n const s = /* @__PURE__ */ new Date().getTime(),\n n = e - s;\n n > 0 && setTimeout(t, n);\n }\n}\nclass R {\n constructor() {\n i(this, 'REDIRECT_VALUE', 'fa-sdk-redirect-value');\n }\n handlePreRedirect(e) {\n const t = `${this.generateRandomString()}:${e ?? ''}`;\n localStorage.setItem(this.REDIRECT_VALUE, t);\n }\n handlePostRedirect(e) {\n const t = this.stateValue ?? void 0;\n e == null || e(t), localStorage.removeItem(this.REDIRECT_VALUE);\n }\n get didRedirect() {\n return !!localStorage.getItem(this.REDIRECT_VALUE);\n }\n get stateValue() {\n const e = localStorage.getItem(this.REDIRECT_VALUE);\n if (!e) return null;\n const [, ...t] = e.split(':');\n return t.join(':');\n }\n generateRandomString() {\n const e = new Uint32Array(28);\n return (\n window.crypto.getRandomValues(e),\n Array.from(e, t => ('0' + t.toString(16)).substring(-2)).join('')\n );\n }\n}\nclass T {\n constructor(e) {\n i(this, 'config');\n i(this, 'urlHelper');\n i(this, 'tokenRefresher');\n i(this, 'redirectHelper', new R());\n (this.config = e),\n (this.urlHelper = new g({\n serverUrl: e.serverUrl,\n clientId: e.clientId,\n redirectUri: e.redirectUri,\n scope: e.scope,\n mePath: e.mePath,\n loginPath: e.loginPath,\n registerPath: e.registerPath,\n logoutPath: e.logoutPath,\n tokenRefreshPath: e.tokenRefreshPath,\n })),\n (this.tokenRefresher = new p(this.urlHelper.getTokenRefreshUrl())),\n this.scheduleTokenExpirationEvent();\n }\n startLogin(e) {\n this.redirectHelper.handlePreRedirect(e),\n window.location.assign(this.urlHelper.getLoginUrl(e));\n }\n startRegister(e) {\n this.redirectHelper.handlePreRedirect(e),\n window.location.assign(this.urlHelper.getRegisterUrl(e));\n }\n startLogout() {\n window.location.assign(this.urlHelper.getLogoutUrl());\n }\n async fetchUserInfo() {\n const e = await fetch(this.urlHelper.getMeUrl(), {\n credentials: 'include',\n });\n if (!e.ok)\n throw new Error(\n `Unable to fetch userInfo in fusionauth. Request failed with status code ${e == null ? void 0 : e.status}`,\n );\n return await e.json();\n }\n async refreshToken() {\n return await this.tokenRefresher.refreshToken();\n }\n initAutoRefresh() {\n return this.tokenRefresher.initAutoRefresh(\n this.config.autoRefreshSecondsBeforeExpiry,\n this.config.accessTokenExpireCookieName,\n );\n }\n handlePostRedirect(e) {\n this.isLoggedIn &&\n this.redirectHelper.didRedirect &&\n this.redirectHelper.handlePostRedirect(e);\n }\n get isLoggedIn() {\n return this.accessTokenExpirationMoment\n ? this.accessTokenExpirationMoment > /* @__PURE__ */ new Date().getTime()\n : !1;\n }\n get accessTokenExpirationMoment() {\n return o.getAccessTokenExpirationMoment(\n this.config.accessTokenExpireCookieName,\n );\n }\n scheduleTokenExpirationEvent() {\n this.accessTokenExpirationMoment &&\n this.config.onTokenExpiration &&\n m.scheduleTokenExpirationCallback(\n this.accessTokenExpirationMoment,\n this.config.onTokenExpiration,\n );\n }\n}\nfunction U() {\n const r = /* @__PURE__ */ new Date();\n r.setHours(r.getHours() + 1);\n const e = r.getTime() / 1e3;\n document.cookie = `app.at_exp=${e}`;\n}\nfunction P() {\n document.cookie = 'app.at_exp=;expires=Thu, 01 Jan 1970 00:00:00 GMT';\n}\nfunction E(r) {\n const e = {\n ...window.location,\n assign: r.fn(),\n };\n return r.spyOn(window, 'location', 'get').mockReturnValue(e), e;\n}\nexport {\n o as CookieHelpers,\n T as SDKCore,\n p as TokenRefresher,\n g as UrlHelper,\n U as mockIsLoggedIn,\n E as mockWindowLocation,\n P as removeAt_expCookie,\n};\n","import { SDKCore } from './core';\nimport { FusionAuthConfig, UserInfo } from './types';\nimport { Observable, catchError, BehaviorSubject } from 'rxjs';\n\n/**\n * Service class to use with FusionAuth backend endpoints.\n */\nexport class FusionAuthService {\n private core: SDKCore;\n private autoRefreshTimer?: NodeJS.Timeout;\n private isLoggedInSubject: BehaviorSubject<boolean>;\n\n constructor(config: FusionAuthConfig) {\n this.core = new SDKCore({\n ...config,\n onTokenExpiration: () => {\n this.isLoggedInSubject.next(false);\n },\n });\n\n this.isLoggedInSubject = new BehaviorSubject(this.core.isLoggedIn);\n this.isLoggedIn$ = this.isLoggedInSubject.asObservable();\n\n this.core.handlePostRedirect(config.onRedirect);\n\n if (config.shouldAutoRefresh && this.core.isLoggedIn) {\n this.initAutoRefresh();\n }\n }\n\n /** An observable representing whether the user is logged in. */\n isLoggedIn$: Observable<boolean>;\n\n /** A function that returns whether the user is logged in. This returned value is non-observable. */\n isLoggedIn() {\n return this.core.isLoggedIn;\n }\n\n /**\n * Refreshes the access token a single time.\n * Automatic token refreshing can be enabled if the SDK is configured with `shouldAutoRefresh`.\n */\n async refreshToken(): Promise<void> {\n return await this.core.refreshToken();\n }\n\n /**\n * Initializes automatic access token refreshing.\n * This is handled automatically if the SDK is configured with `shouldAutoRefresh`.\n */\n initAutoRefresh(): void {\n if (this.autoRefreshTimer) {\n clearTimeout(this.autoRefreshTimer);\n }\n\n this.autoRefreshTimer = this.core.initAutoRefresh();\n }\n\n /**\n * Returns an observable request that fetches userInfo, and catches error.\n */\n getUserInfoObservable(callbacks?: {\n onBegin?: () => void;\n onDone?: () => void;\n }): Observable<UserInfo> {\n callbacks?.onBegin?.();\n return new Observable<UserInfo>(observer => {\n this.core\n .fetchUserInfo()\n .then(userInfo => {\n observer.next(userInfo);\n })\n .catch(error => {\n observer.error(error);\n })\n .finally(() => {\n callbacks?.onDone?.();\n });\n }).pipe(\n catchError(error => {\n throw error;\n }),\n );\n }\n\n /**\n * Fetches userInfo from the 'me' endpoint.\n * @throws {Error} - if an error occurred while fetching.\n */\n async getUserInfo(): Promise<UserInfo> {\n return await this.core.fetchUserInfo();\n }\n\n /**\n * Initiates login flow.\n * @param {string} [state] - Optional value to be echoed back to the SDK upon redirect.\n */\n startLogin(state?: string): void {\n this.core.startLogin(state);\n }\n\n /**\n * Initiates register flow.\n * @param {string} [state] - Optional value to be echoed back to the SDK upon redirect.\n */\n startRegistration(state?: string): void {\n this.core.startRegister(state);\n }\n\n /**\n * Initiates logout flow.\n */\n logout(): void {\n this.core.startLogout();\n }\n}\n","import { Component, Input } from '@angular/core';\nimport { FusionAuthService } from '../../fusion-auth.service';\n\n@Component({\n selector: 'fa-login',\n templateUrl: './fusion-auth-login-button.component.html',\n styleUrls: ['./fusion-auth-login-button.component.scss'],\n})\nexport class FusionAuthLoginButtonComponent {\n @Input() state: string | undefined;\n\n constructor(private fusionAuth: FusionAuthService) {}\n\n login() {\n this.fusionAuth.startLogin(this.state);\n }\n}\n","<button class=\"fa-button\" (click)=\"login()\">\n <span>Login</span>\n</button>\n","import { Component } from '@angular/core';\nimport { FusionAuthService } from '../../fusion-auth.service';\n\n@Component({\n selector: 'fa-logout',\n templateUrl: './fusion-auth-logout-button.component.html',\n styleUrls: ['./fusion-auth-logout-button.component.scss'],\n})\nexport class FusionAuthLogoutButtonComponent {\n constructor(private fusionAuth: FusionAuthService) {}\n\n logout() {\n this.fusionAuth.logout();\n }\n}\n","<button class=\"fa-logout-button\" (click)=\"logout()\">\n <span>logout</span>\n</button>\n","import { Component, Input } from '@angular/core';\nimport { FusionAuthService } from '../../fusion-auth.service';\n\n@Component({\n selector: 'fa-register',\n templateUrl: './fusion-auth-register-button.component.html',\n styleUrls: ['./fusion-auth-register-button.component.scss'],\n})\nexport class FusionAuthRegisterButtonComponent {\n @Input() state: string | undefined;\n\n constructor(private fusionAuth: FusionAuthService) {}\n\n register() {\n this.fusionAuth.startRegistration(this.state);\n }\n}\n","<button class=\"fa-button\" (click)=\"register()\">\n <span>Register Now</span>\n</button>\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { FusionAuthConfig } from './types';\nimport { FusionAuthService } from './fusion-auth.service';\nimport { FusionAuthLoginButtonComponent } from './components/fusionauth-login.button/fusion-auth-login-button.component';\nimport { FusionAuthLogoutButtonComponent } from './components/fusionauth-logout.button/fusion-auth-logout-button.component';\nimport { FusionAuthRegisterButtonComponent } from './components/fusionauth-register.button/fusion-auth-register-button.component';\n\n@NgModule({\n declarations: [\n FusionAuthLoginButtonComponent,\n FusionAuthLogoutButtonComponent,\n FusionAuthRegisterButtonComponent,\n ],\n imports: [],\n exports: [\n FusionAuthLoginButtonComponent,\n FusionAuthLogoutButtonComponent,\n FusionAuthRegisterButtonComponent,\n ],\n})\nexport class FusionAuthModule {\n static forRoot(\n fusionAuthConfig: FusionAuthConfig,\n ): ModuleWithProviders<FusionAuthModule> {\n return {\n ngModule: FusionAuthModule,\n providers: [\n {\n provide: FusionAuthService,\n useValue: new FusionAuthService(fusionAuthConfig),\n },\n ],\n };\n }\n}\n","/*\n * Public API Surface of fusionauth-angular-sdk\n */\n\nexport * from './lib/fusion-auth.service';\nexport * from './lib/components/fusionauth-login.button/fusion-auth-login-button.component';\nexport * from './lib/components/fusionauth-logout.button/fusion-auth-logout-button.component';\nexport * from './lib/components/fusionauth-register.button/fusion-auth-register-button.component';\nexport * from './lib/fusion-auth.module';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["SDKCore","i1.FusionAuthService"],"mappings":";;;;AAAA;AACA,MAAM,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC;AAChC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAChB,CAAC,IAAI,CAAC;MACF,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;OACpE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACjB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvE,MAAM,CAAC,CAAA;AACL,IAAA,WAAA,CAAY,CAAC,EAAA;AACX,QAAA,CAAC,C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