@@ -8,14 +8,17 @@ import WindowAuthenticationBar from '../containers/WindowAuthenticationBar';
88 * Opens a new window for click
99 */
1010export 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
109112IIIFAuthentication . 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