@@ -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 ) ;
@@ -95,8 +98,6 @@ export function IIIFAuthentication({
9598 ) ;
9699 } ;
97100
98- if ( ! authServiceId ) return null ;
99-
100101 if ( status === null ) return renderLogin ( ) ;
101102 if ( status === 'cookie' ) return renderLoggingInCookie ( ) ;
102103 if ( status === 'token' ) return renderLoggingInToken ( ) ;
@@ -107,8 +108,8 @@ export function IIIFAuthentication({
107108}
108109
109110IIIFAuthentication . propTypes = {
110- accessTokenServiceId : PropTypes . string . isRequired ,
111- authServiceId : PropTypes . string . isRequired ,
111+ accessTokenServiceId : PropTypes . string ,
112+ authServiceId : PropTypes . string ,
112113 confirm : PropTypes . string ,
113114 description : PropTypes . string ,
114115 failureDescription : PropTypes . string ,
0 commit comments