diff --git a/pages/_app.tsx b/pages/_app.tsx index 6e62427a10184b9aad01868a52273b6d5525d61d..29745ff3bf6bb502fbfa141da2081b5a4d030ff2 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -58,7 +58,7 @@ const App = (props: React.PropsWithChildren) => { const authProvider: AuthBindings = { login: async () => { - console.log('login') + // console.log('login') signIn('keycloak', { callbackUrl: to ? to.toString() : '/about', redirect: true @@ -69,7 +69,7 @@ const App = (props: React.PropsWithChildren) => { } }, logout: async () => { - console.log('logout') + // console.log('logout') signOut({ redirect: true, callbackUrl: '/about' @@ -80,14 +80,14 @@ const App = (props: React.PropsWithChildren) => { } }, onError: async (error) => { - console.log('onError') + // console.log('onError') console.error(error) return { error } }, check: async () => { - console.log('check') + // console.log('check') if (status === 'unauthenticated') { return { authenticated: false, @@ -100,11 +100,11 @@ const App = (props: React.PropsWithChildren) => { } }, getPermissions: async () => { - console.log('getPermissions') + // console.log('getPermissions') return null }, getIdentity: async () => { - console.log('getIdentity', data) + // console.log('getIdentity', data) if (data?.user) { const { user } = data return { diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts index 9a3931a131919127858477f0ab5109cb54c23098..c4d36c81c3ff3aa9d0a05298c4e24f6453608f18 100644 --- a/pages/api/auth/[...nextauth].ts +++ b/pages/api/auth/[...nextauth].ts @@ -28,7 +28,7 @@ async function refreshAccessToken (token: any) { if (!response.ok) { throw refreshedTokens } - console.log('### refreshToken', new Date().toISOString(), refreshedTokens, '### ### ###') + // console.log('### refreshToken', new Date().toISOString(), refreshedTokens, '### ### ###') return { ...token, @@ -37,7 +37,7 @@ async function refreshAccessToken (token: any) { refreshToken: refreshedTokens.refresh_token ?? token.refreshToken // Fall back to old refresh token } } catch (error) { - console.log('### RefreshAccessTokenError', error, '### ### ###') + // console.log('### RefreshAccessTokenError', error, '### ### ###') return { ...token, @@ -61,7 +61,7 @@ export const authOptions = { issuer, // authorization: { params: { scope: 'openid profile email' } }, profile (profile) { - console.log('### profile', profile, '### ### ###') + // console.log('### profile', profile, '### ### ###') return { id: profile.sub, name: profile.name ?? profile.preferred_username @@ -71,11 +71,11 @@ export const authOptions = { ], callbacks: { async signIn ({ user, account, profile, email, credentials }: any) { - console.log('### signIn', user, account, profile, email, credentials, '### ### ###') + // console.log('### signIn', user, account, profile, email, credentials, '### ### ###') return true }, async session ({ session, user, token }: any) { - console.log('### session', session, user, token, '### ### ###') + // console.log('### session', session, user, token, '### ### ###') session.user = token.user session.accessToken = token.accessToken @@ -84,11 +84,11 @@ export const authOptions = { return session }, async redirect ({ url, baseUrl }: any) { - console.log('### redirect', url, baseUrl, '### ### ###') + // console.log('### redirect', url, baseUrl, '### ### ###') return Promise.resolve(url) }, async jwt ({ token, user, account, profile, isNewUser }: any) { - console.log('### jwt', token, user, account, profile, isNewUser, '### ### ###') + // console.log('### jwt', token, user, account, profile, isNewUser, '### ### ###') // Initial sign in if (account && user) { diff --git a/src/components/fdos/list.tsx b/src/components/fdos/list.tsx index bab89da72bbfc41f228bd644d9870488c79d72e3..f3dc4718c9ebb150fb063a4ff36bf152eeda2163 100644 --- a/src/components/fdos/list.tsx +++ b/src/components/fdos/list.tsx @@ -23,7 +23,11 @@ const columns: Array<GridColDef<OperationsLogRecord>> = [ headerName: 'FDO', minWidth: 200, flex: 1, - type: 'string' + type: 'string', + renderCell: (params): string => { + console.log('params', params) + return '' + } } ] diff --git a/src/components/profiles/list.tsx b/src/components/profiles/list.tsx index ba133b87d5121c0ae663ff356e44fa5c8818aa75..62e1230fb000e955112dddcad4b4739595aa423a 100644 --- a/src/components/profiles/list.tsx +++ b/src/components/profiles/list.tsx @@ -16,9 +16,24 @@ const columns: Array<GridColDef<IProfile>> = [ field: 'id', headerName: 'ID', type: 'string', + width: 200 + }, { + field: 'description', + headerName: 'Description', + type: 'string', + minWidth: 200, + flex: 1, + valueGetter: (params) => { + return params?.row?.attributes?.description + } + }, { + field: 'link', + headerName: 'Profile Registry', + type: 'string', width: 200, renderCell: (params) => { - return <Link href={'./profiles/' + params.value}>{params.value}</Link> + const pid = params?.row.attributes.pid + return <Link href={'https://hdl.handle.net/' + pid}>{pid}</Link> } } ] diff --git a/src/interfaces/IProfile.tsx b/src/interfaces/IProfile.tsx index 9a8f63132cedd592c0595129eb8a2b7ab4ad3c33..abc6126476f60a3c7dad69ebc64b2b5c6e9e5859 100644 --- a/src/interfaces/IProfile.tsx +++ b/src/interfaces/IProfile.tsx @@ -1,5 +1,11 @@ +export interface IProfileAttributes { + pid: string + description: string +} + export interface IProfile { id: string + attributes: IProfileAttributes } export default IProfile