@elliemae/pui-app-sdk 5.10.5 → 5.10.7
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/utils/auth/index.js +1 -1
- package/dist/cjs/utils/auth/loginParams.js +1 -1
- package/dist/cjs/view/require-auth.js +3 -1
- package/dist/esm/utils/auth/index.js +1 -1
- package/dist/esm/utils/auth/loginParams.js +1 -1
- package/dist/esm/view/require-auth.js +4 -2
- package/dist/types/lib/utils/auth/loginParams.d.ts +3 -2
- package/dist/types/lib/utils/auth/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -119,7 +119,7 @@ const authorize = async ({
|
|
|
119
119
|
scope,
|
|
120
120
|
redirectUri
|
|
121
121
|
});
|
|
122
|
-
(0, import_loginParams.setLoginParams)({ clientId, scope, responseType, redirectUri
|
|
122
|
+
(0, import_loginParams.setLoginParams)({ clientId, scope, responseType, redirectUri });
|
|
123
123
|
const authorizationToken = `${tokenType} ${accessToken}`;
|
|
124
124
|
(0, import_helper.setAuthorizationHeader)(authorizationToken);
|
|
125
125
|
const introspectResponse = await (0, import_auth.introspectToken)({
|
|
@@ -24,6 +24,6 @@ __export(loginParams_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(loginParams_exports);
|
|
25
25
|
let loginParams;
|
|
26
26
|
const setLoginParams = (params) => {
|
|
27
|
-
loginParams = params;
|
|
27
|
+
loginParams = { redirectUri: new URL(window.location.href).href, ...params };
|
|
28
28
|
};
|
|
29
29
|
const getLoginParams = () => loginParams;
|
|
@@ -39,6 +39,7 @@ var import_auth = require("../sideeffect/auth/index.js");
|
|
|
39
39
|
var import_login = require("./login/index.js");
|
|
40
40
|
var import_auth2 = require("../utils/auth/index.js");
|
|
41
41
|
var import_props = require("../communication/http-client/props.js");
|
|
42
|
+
var import_loginParams = require("../utils/auth/loginParams.js");
|
|
42
43
|
const key = "auth";
|
|
43
44
|
const RequireAuth = ({
|
|
44
45
|
children,
|
|
@@ -55,7 +56,8 @@ const RequireAuth = ({
|
|
|
55
56
|
import_props.httpClientProps.endSession = import_auth2.endSession;
|
|
56
57
|
const userAuthorized = (0, import_auth2.isUserAuthorized)();
|
|
57
58
|
if (userAuthorized) {
|
|
58
|
-
|
|
59
|
+
(0, import_loginParams.setLoginParams)({ clientId, scope, responseType });
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AuthManager, { children });
|
|
59
61
|
}
|
|
60
62
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AuthManager, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_login.Login, { clientId, scope, responseType, children }) });
|
|
61
63
|
};
|
|
@@ -95,7 +95,7 @@ const authorize = async ({
|
|
|
95
95
|
scope,
|
|
96
96
|
redirectUri
|
|
97
97
|
});
|
|
98
|
-
setLoginParams({ clientId, scope, responseType, redirectUri
|
|
98
|
+
setLoginParams({ clientId, scope, responseType, redirectUri });
|
|
99
99
|
const authorizationToken = `${tokenType} ${accessToken}`;
|
|
100
100
|
setAuthorizationHeader(authorizationToken);
|
|
101
101
|
const introspectResponse = await introspectToken({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createManager } from "redux-injectors";
|
|
3
3
|
import enums from "../utils/constants.js";
|
|
4
4
|
import { authReducer } from "../data/auth/reducer.js";
|
|
@@ -6,6 +6,7 @@ import { authentication } from "../sideeffect/auth/index.js";
|
|
|
6
6
|
import { Login } from "./login/index.js";
|
|
7
7
|
import { endSession, isUserAuthorized } from "../utils/auth/index.js";
|
|
8
8
|
import { httpClientProps } from "../communication/http-client/props.js";
|
|
9
|
+
import { setLoginParams } from "../utils/auth/loginParams.js";
|
|
9
10
|
const key = "auth";
|
|
10
11
|
const RequireAuth = ({
|
|
11
12
|
children,
|
|
@@ -22,7 +23,8 @@ const RequireAuth = ({
|
|
|
22
23
|
httpClientProps.endSession = endSession;
|
|
23
24
|
const userAuthorized = isUserAuthorized();
|
|
24
25
|
if (userAuthorized) {
|
|
25
|
-
|
|
26
|
+
setLoginParams({ clientId, scope, responseType });
|
|
27
|
+
return /* @__PURE__ */ jsx(AuthManager, { children });
|
|
26
28
|
}
|
|
27
29
|
return /* @__PURE__ */ jsx(AuthManager, { children: /* @__PURE__ */ jsx(Login, { clientId, scope, responseType, children }) });
|
|
28
30
|
};
|
|
@@ -3,8 +3,9 @@ type LoginParams = {
|
|
|
3
3
|
scope: string;
|
|
4
4
|
responseType: string;
|
|
5
5
|
redirectUri: string;
|
|
6
|
-
code: string;
|
|
7
6
|
};
|
|
8
|
-
export declare const setLoginParams: (params: LoginParams
|
|
7
|
+
export declare const setLoginParams: (params: Omit<LoginParams, 'redirectUri'> & {
|
|
8
|
+
redirectUri?: string;
|
|
9
|
+
}) => void;
|
|
9
10
|
export declare const getLoginParams: () => LoginParams;
|
|
10
11
|
export {};
|