Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Create GetFullPathToken #142

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

revskill10
Copy link

In some cases, user wants to have custom namespace/claims in JWT token.

@revskill10 revskill10 closed this Sep 13, 2018
@KevinGrandon
Copy link
Contributor

It looks like this was closed in favor of https://github.com/fusionjs/fusion-plugin-jwt/pull/143/files.

Personally I like this approach better, but will check with the team on what we think the best API is. Possibly some combination of the two where we can pass in an override per set call?

@revskill10
Copy link
Author

@KevinGrandon Ah, interesting. This PR could help for default dataPath i think.

@revskill10 revskill10 reopened this Sep 14, 2018
Copy link
Contributor

@KevinGrandon KevinGrandon left a comment

Choose a reason for hiding this comment

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

Sorry about the delay on this. I think this seems reasonable to me, but we'd probably want to add some tests. I'm going to get some additional feedback from the team, and we can help /w tests.

@lhorie
Copy link
Contributor

lhorie commented Sep 24, 2018

LGTM

Copy link
Contributor

@KevinGrandon KevinGrandon left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and sorry for the delay reviewing. We'd be happy to help land this, but this needs a little bit of work. Leaving review notes here in case you want to attempt to fix these yourself. Mainly:

  • Flow needs to pass. You can reproduce this locally with yarn flow.
  • Linters need to pass. You can autofix this locally with yarn lint --fix.
  • We should export GetFullPathToken from index.js.
  • It would be great if we could add a unit test for GetFullPathToken, possibly in the existing test.node.js file.

const service: SessionService = {
from: memoize((ctx: Context) => {
return new JWTSession(ctx, {secret, cookieName, expires});
return new JWTSession(ctx, {secret, cookieName, expires, getFullPath(ctx)});
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently this is specified as part of config here, but specified as another constructor parameter in JWTSession. I'm assuming that since config is fairly session specific, that this should be another parameter here instead of in config.

Copy link
Author

Choose a reason for hiding this comment

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

@KevinGrandon Agree, so in this case we will sepaprate geFullPath out of config object. Thanks.

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

Successfully merging this pull request may close these issues.

None yet

4 participants