@arv-bedrock/auth-sso 0.1.0 → 0.1.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.
package/dist/cjs/auth.js CHANGED
@@ -35,7 +35,7 @@ class Auth {
35
35
  this.defaultCallback = "";
36
36
  this.user = { userId: '', email: '' };
37
37
  this.queryString = '';
38
- this.clientInit = { logoutUrl: '' };
38
+ this.clientInit = { logoutUrl: '', portalHomeUrl: '', isPortal: false };
39
39
  }
40
40
  isCitizen() {
41
41
  return this.userType === "citizen";
@@ -69,9 +69,8 @@ class Auth {
69
69
  }
70
70
  window.location.replace(target);
71
71
  }
72
- doRegister(redirectUrl = this.defaultCallback) {
73
- const url = new URL(redirectUrl, this.frontendHost).toString();
74
- const callbackURL = encodeURIComponent(url);
72
+ doRegister() {
73
+ const callbackURL = window.location.origin;
75
74
  let location = `${this.authHost}/auth/register?redirectUri=${callbackURL}&client_id=${this.clientId}`;
76
75
  if (this.isCitizen()) {
77
76
  location = `${this.authHost}/auth/${constant_1.CITIZEN}/main-register?redirectUri=${callbackURL}&client_id=${this.clientId}`;
@@ -102,12 +101,6 @@ class Auth {
102
101
  this.clientInit = res.data;
103
102
  });
104
103
  }
105
- doResetPassword() {
106
- window.location.replace(`${this.authHost}/auth/change-password?redirectUri=${window.location.href}&client_id=${this.clientId}&user_type=${this.userType}`);
107
- }
108
- doForgotPassword() {
109
- window.location.replace(`${this.authHost}/auth/forgot-password?redirectUri=${window.location.href}&client_id=${this.clientId}&user_type=${this.userType}`);
110
- }
111
104
  setCookie(code) {
112
105
  return __awaiter(this, void 0, void 0, function* () {
113
106
  const codeParam = `${constant_1.CODE}=${code}`;
@@ -152,8 +145,11 @@ class Auth {
152
145
  }
153
146
  });
154
147
  }
155
- doPortal(redirectUrl) {
156
- window.location.replace(`${redirectUrl}?client_id=${this.clientId}&user_type=${this.userType}`);
148
+ doPortal() {
149
+ if (this.clientInit.isPortal) {
150
+ return this.doLogout();
151
+ }
152
+ window.location.replace(`${this.clientInit.portalHomeUrl}?client_id=${this.clientId}&user_type=${this.userType}`);
157
153
  }
158
154
  }
159
155
  const bedRockAuth = new Auth();
package/dist/cjs/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.doPortal = exports.getCode = exports.clearCookie = exports.getClientInfo = exports.getProfile = exports.setCookie = exports.doForgotPassword = exports.doResetPassword = exports.doRegister = exports.doLogout = exports.doLogin = exports.initBedrockAuth = void 0;
6
+ exports.doPortal = exports.getCode = exports.clearCookie = exports.getClientInfo = exports.getProfile = exports.setCookie = exports.doRegister = exports.doLogout = exports.doLogin = exports.initBedrockAuth = void 0;
7
7
  const auth_1 = __importDefault(require("./auth"));
8
8
  const initBedrockAuth = ({ authUri, clientId, clientSecret, callback, userType, }) => {
9
9
  auth_1.default.init({
@@ -22,12 +22,8 @@ const doLogin = (redirectUrl) => auth_1.default.doLogin(redirectUrl);
22
22
  exports.doLogin = doLogin;
23
23
  const doLogout = () => auth_1.default.doLogout();
24
24
  exports.doLogout = doLogout;
25
- const doRegister = (redirectUrl) => auth_1.default.doRegister(redirectUrl);
25
+ const doRegister = () => auth_1.default.doRegister();
26
26
  exports.doRegister = doRegister;
27
- const doResetPassword = () => auth_1.default.doResetPassword();
28
- exports.doResetPassword = doResetPassword;
29
- const doForgotPassword = () => auth_1.default.doForgotPassword();
30
- exports.doForgotPassword = doForgotPassword;
31
27
  const setCookie = (code) => auth_1.default.setCookie(code);
32
28
  exports.setCookie = setCookie;
33
29
  const getProfile = () => auth_1.default.getProfile();
@@ -38,5 +34,5 @@ const clearCookie = () => auth_1.default.clearCookie();
38
34
  exports.clearCookie = clearCookie;
39
35
  const getCode = () => auth_1.default.getCode();
40
36
  exports.getCode = getCode;
41
- const doPortal = (redirectUrl) => auth_1.default.doPortal(redirectUrl);
37
+ const doPortal = () => auth_1.default.doPortal();
42
38
  exports.doPortal = doPortal;
@@ -21,10 +21,12 @@ export interface AuthServiceRequest {
21
21
  }
22
22
  export interface ClientInfo {
23
23
  url: string;
24
- isPortal: string;
24
+ isPortal: boolean;
25
25
  }
26
26
  export interface ClientInit {
27
27
  logoutUrl: string;
28
+ portalHomeUrl: string;
29
+ isPortal: boolean;
28
30
  }
29
31
  declare class Auth {
30
32
  private userType;
@@ -43,17 +45,15 @@ declare class Auth {
43
45
  private removeUrlParam;
44
46
  doLogin(redirectUrl?: string): void;
45
47
  doLogout: () => Promise<void>;
46
- doRegister(redirectUrl?: string): void;
48
+ doRegister(): void;
47
49
  private createQueryParam;
48
50
  init(options: Options): Promise<void>;
49
- doResetPassword(): void;
50
- doForgotPassword(): void;
51
51
  setCookie(code: string): Promise<void>;
52
52
  getClientInfo(): Promise<ResponseData<ClientInfo>>;
53
53
  private getClientInit;
54
54
  clearCookie(): Promise<void>;
55
55
  getProfile(): Promise<AuthServiceResponse | undefined>;
56
- doPortal(redirectUrl: string): void;
56
+ doPortal(): Promise<void> | undefined;
57
57
  }
58
58
  declare const bedRockAuth: Auth;
59
59
  export default bedRockAuth;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../auth.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAM7C,UAAU,OAAO;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE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,aAAa;IAMd,WAAW;IAOX,UAAU;IAYhB,QAAQ;CAUhB;AAED,QAAA,MAAM,WAAW,MAAa,CAAC;AAE/B,eAAe,WAAW,CAAC"}
@@ -9,13 +9,11 @@ export type AuthProps = {
9
9
  export declare const initBedrockAuth: ({ authUri, clientId, clientSecret, callback, userType, }: AuthProps) => void;
10
10
  export declare const doLogin: (redirectUrl?: string) => void;
11
11
  export declare const doLogout: () => Promise<void>;
12
- export declare const doRegister: (redirectUrl?: string) => void;
13
- export declare const doResetPassword: () => void;
14
- export declare const doForgotPassword: () => void;
12
+ export declare const doRegister: () => void;
15
13
  export declare const setCookie: (code: string) => Promise<void>;
16
14
  export declare const getProfile: () => Promise<import("./auth").AuthServiceResponse | undefined>;
17
15
  export declare const getClientInfo: () => Promise<import("./auth").ResponseData<import("./auth").ClientInfo>>;
18
16
  export declare const clearCookie: () => Promise<void>;
19
17
  export declare const getCode: () => string;
20
- export declare const doPortal: (redirectUrl: string) => void;
18
+ export declare const doPortal: () => Promise<void> | undefined;
21
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,OAAW,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAG,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,6DAMzB,SAAS,SAWX,CAAC;AAEF,eAAO,MAAM,OAAO,iBAAkB,MAAM,SAA4B,CAAC;AAEzE,eAAO,MAAM,QAAQ,qBAAsB,CAAC;AAE5C,eAAO,MAAM,UAAU,iBAAkB,MAAM,SAA+B,CAAC;AAE/E,eAAO,MAAM,eAAe,YAA6B,CAAC;AAE1D,eAAO,MAAM,gBAAgB,YAA8B,CAAC;AAE5D,eAAO,MAAM,SAAS,SAAW,MAAM,kBAAuB,CAAC;AAE/D,eAAO,MAAM,UAAU,iEAAwB,CAAC;AAEhD,eAAO,MAAM,aAAa,2EAA2B,CAAC;AAEtD,eAAO,MAAM,WAAW,qBAAyB,CAAC;AAElD,eAAO,MAAM,OAAO,cAAoB,CAAC;AAEzC,eAAO,MAAM,QAAQ,gBAAgB,MAAM,SAA4B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,OAAW,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAG,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,6DAMzB,SAAS,SAWX,CAAC;AAEF,eAAO,MAAM,OAAO,iBAAkB,MAAM,SAA4B,CAAC;AAEzE,eAAO,MAAM,QAAQ,qBAAsB,CAAC;AAE5C,eAAO,MAAM,UAAU,YAAwB,CAAC;AAEhD,eAAO,MAAM,SAAS,SAAW,MAAM,kBAAuB,CAAC;AAE/D,eAAO,MAAM,UAAU,iEAAwB,CAAC;AAEhD,eAAO,MAAM,aAAa,2EAA2B,CAAC;AAEtD,eAAO,MAAM,WAAW,qBAAyB,CAAC;AAElD,eAAO,MAAM,OAAO,cAAoB,CAAC;AAEzC,eAAO,MAAM,QAAQ,iCAAoB,CAAA"}
package/dist/esm/auth.js CHANGED
@@ -19,7 +19,7 @@ class Auth {
19
19
  this.defaultCallback = "";
20
20
  this.user = { userId: '', email: '' };
21
21
  this.queryString = '';
22
- this.clientInit = { logoutUrl: '' };
22
+ this.clientInit = { logoutUrl: '', portalHomeUrl: '', isPortal: false };
23
23
  }
24
24
  isCitizen() {
25
25
  return this.userType === "citizen";
@@ -64,9 +64,8 @@ class Auth {
64
64
  this.doLogin();
65
65
  }
66
66
  };
67
- doRegister(redirectUrl = this.defaultCallback) {
68
- const url = new URL(redirectUrl, this.frontendHost).toString();
69
- const callbackURL = encodeURIComponent(url);
67
+ doRegister() {
68
+ const callbackURL = window.location.origin;
70
69
  let location = `${this.authHost}/auth/register?redirectUri=${callbackURL}&client_id=${this.clientId}`;
71
70
  if (this.isCitizen()) {
72
71
  location = `${this.authHost}/auth/${CITIZEN}/main-register?redirectUri=${callbackURL}&client_id=${this.clientId}`;
@@ -95,12 +94,6 @@ class Auth {
95
94
  }
96
95
  this.clientInit = res.data;
97
96
  }
98
- doResetPassword() {
99
- window.location.replace(`${this.authHost}/auth/change-password?redirectUri=${window.location.href}&client_id=${this.clientId}&user_type=${this.userType}`);
100
- }
101
- doForgotPassword() {
102
- window.location.replace(`${this.authHost}/auth/forgot-password?redirectUri=${window.location.href}&client_id=${this.clientId}&user_type=${this.userType}`);
103
- }
104
97
  async setCookie(code) {
105
98
  const codeParam = `${CODE}=${code}`;
106
99
  await customFetch(`${this.authHost}/api/v1/oauth/cookies?${this.queryString}&${codeParam}`, {
@@ -135,8 +128,11 @@ class Auth {
135
128
  console.log('error', error);
136
129
  }
137
130
  }
138
- doPortal(redirectUrl) {
139
- window.location.replace(`${redirectUrl}?client_id=${this.clientId}&user_type=${this.userType}`);
131
+ doPortal() {
132
+ if (this.clientInit.isPortal) {
133
+ return this.doLogout();
134
+ }
135
+ window.location.replace(`${this.clientInit.portalHomeUrl}?client_id=${this.clientId}&user_type=${this.userType}`);
140
136
  }
141
137
  }
142
138
  const bedRockAuth = new Auth();
@@ -13,12 +13,10 @@ export const initBedrockAuth = ({ authUri, clientId, clientSecret, callback, use
13
13
  };
14
14
  export const doLogin = (redirectUrl) => BR.doLogin(redirectUrl);
15
15
  export const doLogout = () => BR.doLogout();
16
- export const doRegister = (redirectUrl) => BR.doRegister(redirectUrl);
17
- export const doResetPassword = () => BR.doResetPassword();
18
- export const doForgotPassword = () => BR.doForgotPassword();
16
+ export const doRegister = () => BR.doRegister();
19
17
  export const setCookie = (code) => BR.setCookie(code);
20
18
  export const getProfile = () => BR.getProfile();
21
19
  export const getClientInfo = () => BR.getClientInfo();
22
20
  export const clearCookie = () => BR.clearCookie();
23
21
  export const getCode = () => BR.getCode();
24
- export const doPortal = (redirectUrl) => BR.doPortal(redirectUrl);
22
+ export const doPortal = () => BR.doPortal();
@@ -21,10 +21,12 @@ export interface AuthServiceRequest {
21
21
  }
22
22
  export interface ClientInfo {
23
23
  url: string;
24
- isPortal: string;
24
+ isPortal: boolean;
25
25
  }
26
26
  export interface ClientInit {
27
27
  logoutUrl: string;
28
+ portalHomeUrl: string;
29
+ isPortal: boolean;
28
30
  }
29
31
  declare class Auth {
30
32
  private userType;
@@ -43,17 +45,15 @@ declare class Auth {
43
45
  private removeUrlParam;
44
46
  doLogin(redirectUrl?: string): void;
45
47
  doLogout: () => Promise<void>;
46
- doRegister(redirectUrl?: string): void;
48
+ doRegister(): void;
47
49
  private createQueryParam;
48
50
  init(options: Options): Promise<void>;
49
- doResetPassword(): void;
50
- doForgotPassword(): void;
51
51
  setCookie(code: string): Promise<void>;
52
52
  getClientInfo(): Promise<ResponseData<ClientInfo>>;
53
53
  private getClientInit;
54
54
  clearCookie(): Promise<void>;
55
55
  getProfile(): Promise<AuthServiceResponse | undefined>;
56
- doPortal(redirectUrl: string): void;
56
+ doPortal(): Promise<void> | undefined;
57
57
  }
58
58
  declare const bedRockAuth: Auth;
59
59
  export default bedRockAuth;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../auth.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAM7C,UAAU,OAAO;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,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B,OAAO,CAAC,UAAU,CAAc;;IAchC,SAAS;IAIF,OAAO;IAKd,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,cAAc;IAUf,OAAO,CAAC,WAAW,GAAE,MAA6B;IAalD,QAAQ,sBASb;IAEK,UAAU;IAUjB,OAAO,CAAC,gBAAgB;IAQX,IAAI,CAAC,OAAO,EAAE,OAAO;IAkBrB,SAAS,CAAC,IAAI,EAAE,MAAM;IAWtB,aAAa;YAKZ,aAAa;IAMd,WAAW;IAOX,UAAU;IAYhB,QAAQ;CAUhB;AAED,QAAA,MAAM,WAAW,MAAa,CAAC;AAE/B,eAAe,WAAW,CAAC"}
@@ -9,13 +9,11 @@ export type AuthProps = {
9
9
  export declare const initBedrockAuth: ({ authUri, clientId, clientSecret, callback, userType, }: AuthProps) => void;
10
10
  export declare const doLogin: (redirectUrl?: string) => void;
11
11
  export declare const doLogout: () => Promise<void>;
12
- export declare const doRegister: (redirectUrl?: string) => void;
13
- export declare const doResetPassword: () => void;
14
- export declare const doForgotPassword: () => void;
12
+ export declare const doRegister: () => void;
15
13
  export declare const setCookie: (code: string) => Promise<void>;
16
14
  export declare const getProfile: () => Promise<import("./auth").AuthServiceResponse | undefined>;
17
15
  export declare const getClientInfo: () => Promise<import("./auth").ResponseData<import("./auth").ClientInfo>>;
18
16
  export declare const clearCookie: () => Promise<void>;
19
17
  export declare const getCode: () => string;
20
- export declare const doPortal: (redirectUrl: string) => void;
18
+ export declare const doPortal: () => Promise<void> | undefined;
21
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,OAAW,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAG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2B,CAAC;AAEtD,eAAO,MAAM,WAAW,qBAAyB,CAAC;AAElD,eAAO,MAAM,OAAO,cAAoB,CAAC;AAEzC,eAAO,MAAM,QAAQ,iCAAoB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arv-bedrock/auth-sso",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "main": "./dist/cjs/index.js",
5
5
  "types": "./dist/cjs/types/index.d.ts",
6
6
  "scripts": {