@faable/auth-js 1.2.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/README.md +3 -0
- package/dist/Base.d.ts +8 -0
- package/dist/Base.d.ts.map +1 -0
- package/dist/Base.js +16 -0
- package/dist/BaseLog.d.ts +11 -0
- package/dist/BaseLog.d.ts.map +1 -0
- package/dist/BaseLog.js +21 -0
- package/dist/FaableAuthApi.d.ts +14 -0
- package/dist/FaableAuthApi.d.ts.map +1 -0
- package/dist/FaableAuthApi.js +37 -0
- package/dist/FaableAuthClient.d.ts +227 -0
- package/dist/FaableAuthClient.d.ts.map +1 -0
- package/dist/FaableAuthClient.js +1073 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/lib/constants.d.ts +11 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +13 -0
- package/dist/lib/errors.d.ts +83 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +100 -0
- package/dist/lib/fetch.d.ts +8 -0
- package/dist/lib/fetch.d.ts.map +1 -0
- package/dist/lib/fetch.js +53 -0
- package/dist/lib/helpers.d.ts +42 -0
- package/dist/lib/helpers.d.ts.map +1 -0
- package/dist/lib/helpers.js +257 -0
- package/dist/lib/jwt.d.ts +56 -0
- package/dist/lib/jwt.d.ts.map +1 -0
- package/dist/lib/jwt.js +139 -0
- package/dist/lib/local-storage.d.ts +13 -0
- package/dist/lib/local-storage.d.ts.map +1 -0
- package/dist/lib/local-storage.js +45 -0
- package/dist/lib/storage_helpers.d.ts +5 -0
- package/dist/lib/storage_helpers.d.ts.map +1 -0
- package/dist/lib/storage_helpers.js +34 -0
- package/dist/lib/types.d.ts +384 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +6 -0
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +5 -0
- package/dist/lock/Lock.d.ts +20 -0
- package/dist/lock/Lock.d.ts.map +1 -0
- package/dist/lock/Lock.js +82 -0
- package/dist/lock/locks.d.ts +64 -0
- package/dist/lock/locks.d.ts.map +1 -0
- package/dist/lock/locks.js +137 -0
- package/dist/utils.d.ts +18 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +88 -0
- package/package.json +31 -0
package/README.md
ADDED
package/dist/Base.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseLog, BaseLogOptions } from "./BaseLog";
|
|
2
|
+
export declare abstract class Base extends BaseLog {
|
|
3
|
+
private static nextInstanceID;
|
|
4
|
+
private instanceID;
|
|
5
|
+
constructor(config?: BaseLogOptions);
|
|
6
|
+
extraPrint(): string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=Base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../src/Base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpD,8BAAsB,IAAK,SAAQ,OAAO;IACxC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAK;IAClC,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,GAAE,cAAmB;IAMvC,UAAU;CAGX"}
|
package/dist/Base.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Base = void 0;
|
|
4
|
+
const BaseLog_1 = require("./BaseLog");
|
|
5
|
+
class Base extends BaseLog_1.BaseLog {
|
|
6
|
+
constructor(config = {}) {
|
|
7
|
+
super(config);
|
|
8
|
+
this.instanceID = Base.nextInstanceID;
|
|
9
|
+
Base.nextInstanceID += 1;
|
|
10
|
+
}
|
|
11
|
+
extraPrint() {
|
|
12
|
+
return this.instanceID.toString();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Base = Base;
|
|
16
|
+
Base.nextInstanceID = 0;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type BaseLogOptions = {
|
|
2
|
+
debug?: boolean | ((message: string, ...args: any[]) => void);
|
|
3
|
+
};
|
|
4
|
+
export declare abstract class BaseLog {
|
|
5
|
+
protected logDebugMessages: boolean;
|
|
6
|
+
protected logger: (message: string, ...args: any[]) => void;
|
|
7
|
+
constructor(config?: BaseLogOptions);
|
|
8
|
+
protected extraPrint?(): string;
|
|
9
|
+
protected _debug(...args: any[]): this;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=BaseLog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseLog.d.ts","sourceRoot":"","sources":["../src/BaseLog.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC,CAAC;CAC/D,CAAC;AAEF,8BAAsB,OAAO;IAC3B,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACpC,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAe;gBAE9D,MAAM,GAAE,cAAmB;IAOvC,SAAS,CAAC,UAAU,CAAC,IAAI,MAAM;IAE/B,SAAS,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;CAWhC"}
|
package/dist/BaseLog.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseLog = void 0;
|
|
4
|
+
const version_1 = require("./lib/version");
|
|
5
|
+
class BaseLog {
|
|
6
|
+
constructor(config = {}) {
|
|
7
|
+
this.logger = console.log;
|
|
8
|
+
this.logDebugMessages = !!config.debug;
|
|
9
|
+
if (typeof config.debug === "function") {
|
|
10
|
+
this.logger = config.debug;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
_debug(...args) {
|
|
14
|
+
if (this.logDebugMessages) {
|
|
15
|
+
const extra = this.extraPrint ? this.extraPrint() : "";
|
|
16
|
+
this.logger(`FaableAuth@${extra} (${version_1.version}) ${new Date().toISOString()}`, ...args);
|
|
17
|
+
}
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.BaseLog = BaseLog;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseLog, BaseLogOptions } from "./BaseLog";
|
|
2
|
+
import { AuthError } from "./lib/errors";
|
|
3
|
+
export default class FaableAuthApi extends BaseLog {
|
|
4
|
+
base_url: string;
|
|
5
|
+
constructor(base_url: string, config: BaseLogOptions);
|
|
6
|
+
protected extraPrint(): string;
|
|
7
|
+
signOut(params: {
|
|
8
|
+
client_id: string;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
data: null;
|
|
11
|
+
error: AuthError | null;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=FaableAuthApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FaableAuthApi.d.ts","sourceRoot":"","sources":["../src/FaableAuthApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAC7B,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc;IAG3D,SAAS,CAAC,UAAU,IAAI,MAAM;IAIxB,OAAO,CAAC,MAAM,EAAE;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAA;KAAE,CAAC;CAWrD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const BaseLog_1 = require("./BaseLog");
|
|
13
|
+
const fetch_1 = require("./lib/fetch");
|
|
14
|
+
class FaableAuthApi extends BaseLog_1.BaseLog {
|
|
15
|
+
constructor(base_url, config) {
|
|
16
|
+
super(config);
|
|
17
|
+
this.base_url = base_url;
|
|
18
|
+
}
|
|
19
|
+
extraPrint() {
|
|
20
|
+
return "api";
|
|
21
|
+
}
|
|
22
|
+
signOut(params) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const url = `${this.base_url}/logout?${new URLSearchParams(params)}`;
|
|
25
|
+
this._debug(`requesting ${url}`);
|
|
26
|
+
const res = yield (0, fetch_1._get)(url);
|
|
27
|
+
this._debug(res);
|
|
28
|
+
if (res.error) {
|
|
29
|
+
return { error: null, data: null };
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
return res;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = FaableAuthApi;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { AuthFlowType, SupportedStorage, SignInWithOAuthConnection, OAuthResponse, Subscription, InitializeResult, CallRefreshTokenResult } from "./lib/types";
|
|
2
|
+
import { FaableAuthClientConfig, AuthResponse, AuthChangeEvent } from "./lib/types";
|
|
3
|
+
import { Session, SignOut } from "./lib/types";
|
|
4
|
+
import { Deferred } from "./lib/helpers";
|
|
5
|
+
import { AuthError } from "./lib/errors";
|
|
6
|
+
import FaableAuthApi from "./FaableAuthApi";
|
|
7
|
+
import { Base } from "./Base";
|
|
8
|
+
import { Lock } from "./lock/Lock";
|
|
9
|
+
export declare class FaableAuthClient extends Base {
|
|
10
|
+
domainUrl: string;
|
|
11
|
+
tokenIssuer: string;
|
|
12
|
+
redirect_uri: string;
|
|
13
|
+
scope?: string;
|
|
14
|
+
sessionCheckExpiryDays: number;
|
|
15
|
+
protected initializePromise: Promise<InitializeResult> | null;
|
|
16
|
+
protected detectSessionInUrl: boolean;
|
|
17
|
+
protected storageKey: string;
|
|
18
|
+
protected clientId: string;
|
|
19
|
+
protected flowType: AuthFlowType;
|
|
20
|
+
protected storage: SupportedStorage;
|
|
21
|
+
protected api: FaableAuthApi;
|
|
22
|
+
protected autoRefreshToken: boolean;
|
|
23
|
+
protected autoRefreshTicker: ReturnType<typeof setInterval> | null;
|
|
24
|
+
protected visibilityChangedCallback: (() => Promise<any>) | null;
|
|
25
|
+
protected refreshingDeferred: Deferred<CallRefreshTokenResult> | null;
|
|
26
|
+
/**
|
|
27
|
+
* Used to broadcast state change events to other tabs listening.
|
|
28
|
+
*/
|
|
29
|
+
protected broadcastChannel: BroadcastChannel | null;
|
|
30
|
+
protected stateChangeEmitters: Map<string, Subscription>;
|
|
31
|
+
protected lock: Lock;
|
|
32
|
+
constructor(config: FaableAuthClientConfig);
|
|
33
|
+
/**
|
|
34
|
+
* Initializes the client session either from the url or from storage.
|
|
35
|
+
* This method is automatically called when instantiating the client, but should also be called
|
|
36
|
+
* manually when checking for an error from an auth redirect (oauth, magiclink, password recovery, etc).
|
|
37
|
+
*/
|
|
38
|
+
initialize(): Promise<InitializeResult>;
|
|
39
|
+
/**
|
|
40
|
+
* IMPORTANT:
|
|
41
|
+
* 1. Never throw in this method, as it is called from the constructor
|
|
42
|
+
* 2. Never return a session from this method as it would be cached over
|
|
43
|
+
* the whole lifetime of the client
|
|
44
|
+
*/
|
|
45
|
+
private _initialize;
|
|
46
|
+
/**
|
|
47
|
+
* Gets the session data from a URL string
|
|
48
|
+
*/
|
|
49
|
+
private _getSessionFromURL;
|
|
50
|
+
private _exchangeCodeForSession;
|
|
51
|
+
/**
|
|
52
|
+
* Registers callbacks on the browser / platform, which in-turn run
|
|
53
|
+
* algorithms when the browser window/tab are in foreground. On non-browser
|
|
54
|
+
* platforms it assumes always foreground.
|
|
55
|
+
*/
|
|
56
|
+
private _handleVisibilityChange;
|
|
57
|
+
/**
|
|
58
|
+
* Callback registered with `window.addEventListener('visibilitychange')`.
|
|
59
|
+
*/
|
|
60
|
+
private _onVisibilityChanged;
|
|
61
|
+
/**
|
|
62
|
+
* Recovers the session from LocalStorage and refreshes
|
|
63
|
+
* Note: this method is async to accommodate for AsyncStorage e.g. in React native.
|
|
64
|
+
*/
|
|
65
|
+
private _recoverAndRefresh;
|
|
66
|
+
/**
|
|
67
|
+
* Removes any registered visibilitychange callback.
|
|
68
|
+
*
|
|
69
|
+
* {@see #startAutoRefresh}
|
|
70
|
+
* {@see #stopAutoRefresh}
|
|
71
|
+
*/
|
|
72
|
+
private _removeVisibilityChangedCallback;
|
|
73
|
+
/**
|
|
74
|
+
* Starts an auto-refresh process in the background. The session is checked
|
|
75
|
+
* every few seconds. Close to the time of expiration a process is started to
|
|
76
|
+
* refresh the session. If refreshing fails it will be retried for as long as
|
|
77
|
+
* necessary.
|
|
78
|
+
*
|
|
79
|
+
* If you set the {@link GoTrueClientOptions#autoRefreshToken} you don't need
|
|
80
|
+
* to call this function, it will be called for you.
|
|
81
|
+
*
|
|
82
|
+
* On browsers the refresh process works only when the tab/window is in the
|
|
83
|
+
* foreground to conserve resources as well as prevent race conditions and
|
|
84
|
+
* flooding auth with requests. If you call this method any managed
|
|
85
|
+
* visibility change callback will be removed and you must manage visibility
|
|
86
|
+
* changes on your own.
|
|
87
|
+
*
|
|
88
|
+
* On non-browser platforms the refresh process works *continuously* in the
|
|
89
|
+
* background, which may not be desirable. You should hook into your
|
|
90
|
+
* platform's foreground indication mechanism and call these methods
|
|
91
|
+
* appropriately to conserve resources.
|
|
92
|
+
*
|
|
93
|
+
* {@see #stopAutoRefresh}
|
|
94
|
+
*/
|
|
95
|
+
startAutoRefresh(): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* This is the private implementation of {@link #startAutoRefresh}. Use this
|
|
98
|
+
* within the library.
|
|
99
|
+
*/
|
|
100
|
+
private _startAutoRefresh;
|
|
101
|
+
/**
|
|
102
|
+
* This is the private implementation of {@link #stopAutoRefresh}. Use this
|
|
103
|
+
* within the library.
|
|
104
|
+
*/
|
|
105
|
+
private _stopAutoRefresh;
|
|
106
|
+
/**
|
|
107
|
+
* Runs the auto refresh token tick.
|
|
108
|
+
*/
|
|
109
|
+
private _autoRefreshTokenTick;
|
|
110
|
+
/**
|
|
111
|
+
* Checks if the current URL and backing storage contain parameters given by a PKCE flow
|
|
112
|
+
*/
|
|
113
|
+
private _isPKCEFlow;
|
|
114
|
+
/**
|
|
115
|
+
* Checks if the current URL contains parameters given by an implicit oauth grant flow (https://www.rfc-editor.org/rfc/rfc6749.html#section-4.2)
|
|
116
|
+
*/
|
|
117
|
+
private _isImplicitGrantFlow;
|
|
118
|
+
private _scope;
|
|
119
|
+
private _getUrlForConnection;
|
|
120
|
+
signInWithOauthConnection(credentials: SignInWithOAuthConnection): Promise<OAuthResponse>;
|
|
121
|
+
private _handleConnectionSignIn;
|
|
122
|
+
/**
|
|
123
|
+
* Sets the session data from the current session. If the current session is expired, setSession will take care of refreshing it to obtain a new session.
|
|
124
|
+
* If the refresh token or access token in the current session is invalid, an error will be thrown.
|
|
125
|
+
* @param currentSession The current session that minimally contains an access token and refresh token.
|
|
126
|
+
*/
|
|
127
|
+
setSession(currentSession: {
|
|
128
|
+
access_token: string;
|
|
129
|
+
refresh_token: string;
|
|
130
|
+
}): Promise<AuthResponse>;
|
|
131
|
+
/**
|
|
132
|
+
* Returns the session, refreshing it if necessary.
|
|
133
|
+
*
|
|
134
|
+
* The session returned can be null if the session is not detected which can happen in the event a user is not signed-in or has logged out.
|
|
135
|
+
*
|
|
136
|
+
* **IMPORTANT:** This method loads values directly from the storage attached
|
|
137
|
+
* to the client. If that storage is based on request cookies for example,
|
|
138
|
+
* the values in it may not be authentic and therefore it's strongly advised
|
|
139
|
+
* against using this method and its results in such circumstances. A warning
|
|
140
|
+
* will be emitted if this is detected. Use {@link #getUser()} instead.
|
|
141
|
+
*/
|
|
142
|
+
getSession(): Promise<{
|
|
143
|
+
data: {
|
|
144
|
+
session: Session;
|
|
145
|
+
};
|
|
146
|
+
error: null;
|
|
147
|
+
} | {
|
|
148
|
+
data: {
|
|
149
|
+
session: null;
|
|
150
|
+
};
|
|
151
|
+
error: AuthError;
|
|
152
|
+
} | {
|
|
153
|
+
data: {
|
|
154
|
+
session: null;
|
|
155
|
+
};
|
|
156
|
+
error: null;
|
|
157
|
+
}>;
|
|
158
|
+
/**
|
|
159
|
+
* Use instead of {@link #getSession} inside the library. It is
|
|
160
|
+
* semantically usually what you want, as getting a session involves some
|
|
161
|
+
* processing afterwards that requires only one client operating on the
|
|
162
|
+
* session at once across multiple tabs or processes.
|
|
163
|
+
*/
|
|
164
|
+
private _useSession;
|
|
165
|
+
/**
|
|
166
|
+
* NEVER USE DIRECTLY!
|
|
167
|
+
*
|
|
168
|
+
* Always use {@link #_useSession}.
|
|
169
|
+
*/
|
|
170
|
+
private __loadSession;
|
|
171
|
+
private _removeSession;
|
|
172
|
+
private _isValidSession;
|
|
173
|
+
protected _setSession(currentSession: {
|
|
174
|
+
access_token: string;
|
|
175
|
+
refresh_token: string;
|
|
176
|
+
}): Promise<AuthResponse>;
|
|
177
|
+
/**
|
|
178
|
+
* set currentSession and currentUser
|
|
179
|
+
* process to _startAutoRefreshToken if possible
|
|
180
|
+
*/
|
|
181
|
+
private _saveSession;
|
|
182
|
+
private _getUser;
|
|
183
|
+
private _callRefreshToken;
|
|
184
|
+
/**
|
|
185
|
+
* Generates a new JWT.
|
|
186
|
+
* @param refreshToken A valid refresh token that was returned on login.
|
|
187
|
+
*/
|
|
188
|
+
private _refreshAccessToken;
|
|
189
|
+
private _notifyAllSubscribers;
|
|
190
|
+
/**
|
|
191
|
+
* Inside a browser context, `signOut()` will remove the logged in user from the browser session and log them out - removing all items from localstorage and then trigger a `"SIGNED_OUT"` event.
|
|
192
|
+
*
|
|
193
|
+
* For server-side management, you can revoke all refresh tokens for a user by passing a user's JWT through to `auth.api.signOut(JWT: string)`.
|
|
194
|
+
* There is no way to revoke a user's access token jwt until it expires. It is recommended to set a shorter expiry on the jwt for this reason.
|
|
195
|
+
*
|
|
196
|
+
* If using `others` scope, no `SIGNED_OUT` event is fired!
|
|
197
|
+
*/
|
|
198
|
+
signOut(options?: SignOut): Promise<{
|
|
199
|
+
error: AuthError | null;
|
|
200
|
+
}>;
|
|
201
|
+
protected _signOut({ scope }?: SignOut): Promise<{
|
|
202
|
+
error: AuthError | null;
|
|
203
|
+
}>;
|
|
204
|
+
/**
|
|
205
|
+
* Receive a notification every time an auth event happens.
|
|
206
|
+
* @param callback A callback function to be invoked when an auth event happens.
|
|
207
|
+
*/
|
|
208
|
+
onAuthStateChange(callback: (event: AuthChangeEvent, session: Session | null) => void | Promise<void>): {
|
|
209
|
+
data: {
|
|
210
|
+
subscription: Subscription;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
private _emitInitialSession;
|
|
214
|
+
/**
|
|
215
|
+
* Returns a new session, regardless of expiry status.
|
|
216
|
+
* Takes in an optional current session. If not passed in, then refreshSession() will attempt to retrieve it from getSession().
|
|
217
|
+
* If the current session's refresh token is invalid, an error will be thrown.
|
|
218
|
+
* @param currentSession The current session. If passed in, it must contain a refresh token.
|
|
219
|
+
*/
|
|
220
|
+
refreshSession(currentSession?: {
|
|
221
|
+
refresh_token: string;
|
|
222
|
+
}): Promise<AuthResponse>;
|
|
223
|
+
protected _refreshSession(currentSession?: {
|
|
224
|
+
refresh_token: string;
|
|
225
|
+
}): Promise<AuthResponse>;
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=FaableAuthClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FaableAuthClient.d.ts","sourceRoot":"","sources":["../src/FaableAuthClient.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAEhB,sBAAsB,EACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,eAAe,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAyB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EACL,QAAQ,EAQT,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,SAAS,EASV,MAAM,cAAc,CAAC;AAMtB,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AASnC,qBAAa,gBAAiB,SAAQ,IAAI;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB,EAAE,MAAM,CAAC;IAE/B,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CA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