supaapps-auth 1.0.1 → 1.0.3
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/dist/AuthManager.js +2 -1
- package/package.json +1 -1
- package/src/AuthManager.ts +2 -1
package/dist/AuthManager.js
CHANGED
|
@@ -37,6 +37,7 @@ class AuthManager {
|
|
|
37
37
|
this.authServer = authServer;
|
|
38
38
|
this.realmName = realmName;
|
|
39
39
|
this.redirectUri = redirectUri;
|
|
40
|
+
AuthManager.instance = this;
|
|
40
41
|
}
|
|
41
42
|
static getInstance() {
|
|
42
43
|
if (!AuthManager.instance) {
|
|
@@ -50,7 +51,7 @@ class AuthManager {
|
|
|
50
51
|
localStorage.setItem('codeChallenge', codeChallenge);
|
|
51
52
|
if (this.authServer && this.realmName && this.redirectUri) {
|
|
52
53
|
return `${this.authServer}auth/login_with_google?realm_name=${this.realmName}` +
|
|
53
|
-
`&redirect_uri=${encodeURIComponent(this.
|
|
54
|
+
`&redirect_uri=${encodeURIComponent(this.redirectUri)}&code_challenge=${codeChallenge}&code_challenge_method=S256`;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
isLoggedIn() {
|
package/package.json
CHANGED
package/src/AuthManager.ts
CHANGED
|
@@ -13,6 +13,7 @@ export class AuthManager {
|
|
|
13
13
|
this.authServer = authServer;
|
|
14
14
|
this.realmName = realmName;
|
|
15
15
|
this.redirectUri = redirectUri;
|
|
16
|
+
AuthManager.instance = this;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
public static getInstance<T>(): AuthManager{
|
|
@@ -52,7 +53,7 @@ export class AuthManager {
|
|
|
52
53
|
|
|
53
54
|
if (this.authServer && this.realmName && this.redirectUri) {
|
|
54
55
|
return `${this.authServer}auth/login_with_google?realm_name=${this.realmName}` +
|
|
55
|
-
`&redirect_uri=${encodeURIComponent(this.
|
|
56
|
+
`&redirect_uri=${encodeURIComponent(this.redirectUri)}&code_challenge=${codeChallenge}&code_challenge_method=S256`
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
public async isLoggedIn(): Promise<boolean> {
|