Skip to content

Commit cc4174b

Browse files
committed
Remove required props in favor of conditional for IIIF auth
1 parent 3ce464a commit cc4174b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/IIIFAuthentication.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ import WindowAuthenticationBar from '../containers/WindowAuthenticationBar';
88
* Opens a new window for click
99
*/
1010
export function IIIFAuthentication({
11-
accessTokenServiceId, authServiceId, confirm = undefined, description = undefined,
11+
accessTokenServiceId=undefined, authServiceId=undefined, confirm = undefined, description = undefined,
1212
failureDescription = undefined, failureHeader = undefined, features = 'centerscreen',
1313
handleAuthInteraction, header = undefined, isInteractive = true, label = undefined,
1414
logoutConfirm = undefined, logoutServiceId = undefined, openWindow = window.open,
1515
resetAuthenticationState, resolveAccessTokenRequest, resolveAuthenticationRequest,
1616
status = null, windowId,
1717
}) {
1818
const { t } = useTranslation();
19+
20+
if (!accessTokenServiceId || !authServiceId) return null;
21+
1922
/** */
2023
const onReceiveAccessTokenMessage = (payload) => {
2124
resolveAccessTokenRequest(authServiceId, accessTokenServiceId, payload);
@@ -107,8 +110,8 @@ export function IIIFAuthentication({
107110
}
108111

109112
IIIFAuthentication.propTypes = {
110-
accessTokenServiceId: PropTypes.string.isRequired,
111-
authServiceId: PropTypes.string.isRequired,
113+
accessTokenServiceId: PropTypes.string,
114+
authServiceId: PropTypes.string,
112115
confirm: PropTypes.string,
113116
description: PropTypes.string,
114117
failureDescription: PropTypes.string,

0 commit comments

Comments
 (0)