Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session storage clear+oidc silent logout/token revoke+traefik url HTTP GET request to logout of server #681

Open
wants to merge 15 commits into
base: feature/distributed-demo
Choose a base branch
from

Conversation

raiiasingh19
Copy link
Contributor

Fixes #654 and #479

await auth.revokeTokens();

// Make HTTP GET call to logout URL
await fetch(`${process.env.REACT_APP_URL}/_oauth/logout`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raiiasingh19
Some of the installation scenarios don't have a server listening at this address. If not the fetch might throw an error. You might want to write a promise with enough code to handle the exceptions. There might be some in the fetch as well. Please check.

});
}

export async function signOut(userManager: UserManager) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function signOut has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.

});
}

export async function signOut(userManager: UserManager) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function signOut has 41 lines of code (exceeds 25 allowed). Consider refactoring.

});
}

export async function signOut(userManager: UserManager) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function signOut has 40 lines of code (exceeds 25 allowed). Consider refactoring.

});
}

export async function signOut(userManager: UserManager) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function signOut has 44 lines of code (exceeds 25 allowed). Consider refactoring.

client_secret: clientSecret,
};

await fetch(`${process.env.REACT_APP_URL}/_oauth/logout`, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The signout happens via a GET request to this end point. There is no need for a request body. The required information goes via the headers. Please try developer setup and then check localhost/_oauth/logout. Remember to change the the line-11 of libms.dockerfile to

COPY ./deploy/config/lib.docker .

You can then use the browser developer tools to check the headers going to the servers.

client/src/util/auth/Authentication.ts Show resolved Hide resolved
@prasadtalasila
Copy link
Contributor

prasadtalasila commented May 31, 2024

Perhaps bringing out the server logout to a separate function will remove the codeclimate issues. @atomicgamedeveloper The recent comments are valid for PR #793 too.

Copy link

codeclimate bot commented May 31, 2024

Code Climate has analyzed commit 3538d4a and detected 0 issues on this pull request.

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logout of server-side authentication
2 participants