supaapps-auth 2.0.0-rc.1 → 2.0.0-rc.2

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.
@@ -25,18 +25,18 @@ class AuthManager {
25
25
  static initialize(authServer, realmName, redirectUri, onStateChange) {
26
26
  if (!AuthManager.instance) {
27
27
  AuthManager.instance = new AuthManager(authServer, realmName, redirectUri, onStateChange);
28
- }
29
- AuthManager.instance
30
- .checkAccessToken()
31
- .then((token) => {
32
- onStateChange({
33
- type: types_1.AuthEventType.INITALIZED_IN,
34
- user: AuthManager.instance.tokenToPayload(token),
28
+ AuthManager.instance
29
+ .checkAccessToken()
30
+ .then((token) => {
31
+ onStateChange({
32
+ type: types_1.AuthEventType.INITALIZED_IN,
33
+ user: AuthManager.instance.tokenToPayload(token),
34
+ });
35
+ })
36
+ .catch(() => {
37
+ onStateChange({ type: types_1.AuthEventType.INITALIZED_OUT });
35
38
  });
36
- })
37
- .catch(() => {
38
- onStateChange({ type: types_1.AuthEventType.INITALIZED_OUT });
39
- });
39
+ }
40
40
  return AuthManager.instance;
41
41
  }
42
42
  static getInstance() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supaapps-auth",
3
- "version": "2.0.0-rc.1",
3
+ "version": "2.0.0-rc.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -43,8 +43,7 @@ export class AuthManager {
43
43
  redirectUri,
44
44
  onStateChange,
45
45
  );
46
- }
47
- AuthManager.instance
46
+ AuthManager.instance
48
47
  .checkAccessToken()
49
48
  .then((token) => {
50
49
  onStateChange({
@@ -55,6 +54,7 @@ export class AuthManager {
55
54
  .catch(() => {
56
55
  onStateChange({ type: AuthEventType.INITALIZED_OUT });
57
56
  });
57
+ }
58
58
  return AuthManager.instance;
59
59
  }
60
60