diff --git a/node/landing-page/src/App.tsx b/node/landing-page/src/App.tsx index 92dc9bfc..7dad5749 100644 --- a/node/landing-page/src/App.tsx +++ b/node/landing-page/src/App.tsx @@ -45,6 +45,7 @@ function App(): JSX.Element { const [selectedAppDefinition, setSelectedAppDefinition] = useState(initialAppDefinition); const [email, setEmail] = useState(); + const [username, setUsername] = useState(); const [token, setToken] = useState(); const [logoutUrl, setLogoutUrl] = useState(); @@ -132,7 +133,9 @@ function App(): JSX.Element { const userMail = parsedToken.email; setToken(keycloak.idToken); setEmail(userMail); + setUsername(parsedToken.preferred_username ?? userMail); setLogoutUrl(keycloak.createLogoutUrl()); + console.log('Authenticated as ' + username + '(' + userMail + ')'); } } }) @@ -192,7 +195,10 @@ function App(): JSX.Element { const userMail = parsedToken.email; setToken(keycloak.idToken); setEmail(userMail); + setUsername(parsedToken.preferred_username ?? userMail); setLogoutUrl(keycloak.createLogoutUrl()); + console.log('Authenticated as ' + username + '(' + userMail + ')'); + console.log(parsedToken); } } }) @@ -216,7 +222,9 @@ function App(): JSX.Element { // First we split at the / character, get the last part, split at the - character and get the first part const repoName = gitUri ? gitUri?.split('/').pop()?.split('-')[0] : Math.random().toString().substring(2, 10); - const workspace = 'ws-' + config.appId + '-' + selectedAppDefinition + '-' + repoName + '-' + email; + const workspace = config.useEphemeralStorage + ? undefined + : 'ws-' + selectedAppDefinition + '-' + repoName + '-' + username; const requestOptions: RequestOptions = { timeout: 60000,