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

Refactored getCurrentUser.js and setCookie #579

Closed
wants to merge 3 commits into from

Conversation

nikos467
Copy link

Made the export function easier to read

@Neztore Neztore changed the title Refactored getCurrentUser.js Refactored getCurrentUser.js and setCookie Jun 10, 2022
Copy link
Member

@Neztore Neztore left a comment

Choose a reason for hiding this comment

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

Please edit your PR to set the internally stored token in jar

})
}
try {
const res = await getCurrentUser({ jar: { session: args.cookie } })
Copy link
Member

Choose a reason for hiding this comment

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

Could return await getCurrentUser(...); to remove an unnecessary line and variable.

Copy link
Member

Choose a reason for hiding this comment

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

Or, a better solution would be to match the original behaviour and actually set the session token following validation!

Please test your PRs. Reading your code, if validate is enabled the internally stored cookie will never be updated.

@Chosey98
Copy link
Contributor

Chosey98 commented Jul 4, 2022

Matter of fact I just reviewed and pushed the changes @Neztore requested to @nikos467 branch and waiting his approval to merge

@Chosey98 Chosey98 mentioned this pull request Jul 4, 2022
@Neztore
Copy link
Member

Neztore commented Nov 2, 2022

No activity and fixed elsewhere

@Neztore Neztore closed this Nov 2, 2022
Neztore added a commit that referenced this pull request Nov 2, 2022
* Refactored setCookies function

* Fixed lint errors

* Refactored getCurrentUser.js

* Update setCookie.js

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: Josh <hi@nezto.re>
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.

3 participants