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

56 - Add use cases to get the current authenticated user and log out #57

Merged
merged 11 commits into from
May 11, 2023

Conversation

GPortas
Copy link
Contributor

@GPortas GPortas commented Apr 18, 2023

What this PR does / why we need it:

Adds the following use cases to the package:

  • Get the current authenticated user
  • Logout

Both operations work given an auth cookie that comes from the JSF UI. It is the only auth mechanism added for the moment to support the SPA MVP. There is a TODO comment, in the ApiRepository file, providing more information and next steps on this.

Which issue(s) this PR closes:

Special notes for your reviewer:

This PR is part of an end-to-end flow that covers three PRs from three different repositories:

Suggestions on how to test this:

Test the end-to-end flow following the frontend repository PR instructions:

Is there a release notes update needed for this change?:

N/A

Additional documentation:

N/A

@GPortas GPortas self-assigned this Apr 18, 2023
@GPortas GPortas changed the title 56 - Add use case to get the current authenticated user given an auth cookie 56 - Add use cases to get the current authenticated user and log out Apr 24, 2023
@GPortas GPortas marked this pull request as ready for review April 24, 2023 14:59
@GPortas GPortas removed their assignment Apr 24, 2023
@pdurbin pdurbin self-assigned this Apr 25, 2023
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

@GPortas this PR seems to have changes from the recent refactoring? Maybe we need a fresh one?

@GPortas
Copy link
Contributor Author

GPortas commented Apr 26, 2023

I have refreshed the branch with the latest develop changes. Thanks! @pdurbin

@GPortas GPortas removed their assignment Apr 26, 2023
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Overall this looks fine. I'm interested in testing this but ideally all three pull requests would be near final before we do so. The one for Dataverse proper is still being discussed.

I did npm run test and everything passed including tests like "logout".

VS Code is complaining about a line in a test. Not a big deal but it would be nice to not see red:

Screen Shot 2023-04-26 at 9 11 48 AM

authRepositoryStub.logout = sandbox.stub().throwsException(testWriteError);
const sut = new Logout(authRepositoryStub);

let actualError: WriteError = undefined;
Copy link
Member

Choose a reason for hiding this comment

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

VS Code is complaining about this line:

Screen Shot 2023-04-26 at 9 06 10 AM

@mreekie mreekie added the Size: 3 A percentage of a sprint. 2.1 hours. label Apr 26, 2023
pdurbin
pdurbin previously approved these changes May 8, 2023
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Approved. I've been been testing this with the frontend and backend PRs.

@pdurbin
Copy link
Member

pdurbin commented May 8, 2023

Please note that until we address this issue...

... I am taking on faith that the js-dataverse code (this repo) is the same as the tarball that has been put into the frontend PR. For more discussion:

@pdurbin pdurbin removed their assignment May 8, 2023
@kcondon kcondon merged commit 88d3743 into develop May 11, 2023
@kcondon kcondon deleted the 53-users-me branch May 11, 2023 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 3 A percentage of a sprint. 2.1 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add use case to get the current authenticated user given an auth cookie
4 participants