Skip to content

Commit

Permalink
Merge branch 'feat/devcontainer' of github.com:valter-silva-au/aws-pd…
Browse files Browse the repository at this point in the history
…k into feat/devcontainer
  • Loading branch information
valter-silva-au committed Jan 22, 2024
2 parents 30f42bd + e1f222b commit 2b436f6
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,14 @@ const App: React.FC = () => {
const location = useLocation();

useEffect(() => {
if (getAuthenticatedUser) {
const authUser = getAuthenticatedUser();
setUsername(authUser?.getUsername());
const authUser = getAuthenticatedUser();
setUsername(authUser?.getUsername());
authUser?.getSession(() => {
authUser.getUserAttributes((_, attributes) => {
setEmail(attributes?.find((a) => a.Name === "email")?.Value);
});
authUser?.getSession(() => {
authUser.getUserAttributes((_, attributes) => {
setEmail(attributes?.find((a) => a.Name === "email")?.Value);
});
}
});
}, [getAuthenticatedUser, setUsername, setEmail]);

const setAppLayoutPropsSafe = useCallback(
Expand Down Expand Up @@ -103,7 +101,7 @@ const App: React.FC = () => {
}
onSignout={() =>
new Promise(() => {
getAuthenticatedUser && getAuthenticatedUser()?.signOut();
getAuthenticatedUser()?.signOut();
window.location.href = "/";
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ApiExplorer: React.FC = () => {
*/
const sigv4Interceptor = useCallback(async (r: any) => {
const { accessKeyId, secretAccessKey, sessionToken } = await getCredentials(
getAuthenticatedUser?.()!,
getAuthenticatedUser()!,
region,
identityPoolId,
userPoolId
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b436f6

Please sign in to comment.