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

GetUser #10

Closed
santhoshthangaraj opened this issue Jul 30, 2019 · 1 comment
Closed

GetUser #10

santhoshthangaraj opened this issue Jul 30, 2019 · 1 comment
Milestone

Comments

@santhoshthangaraj
Copy link

santhoshthangaraj commented Jul 30, 2019

Thank you for the great package.

How to use the getuser in the auth and refresh token . Please guide on this.

We tried this, but not working
app.use(auth({ getUser: (tokenSet) => {
console.log(tokenSet);
},
authorizationParams: { scope: "openid profile full", response_type: "code" }

}));

@joshcanhelp
Copy link
Contributor

@santhoshthangaraj - Glad you like it!

I'm not sure what you mean about the refresh token but you can adjust the user profile and do any additional user processing you want with the getUser config you mentioned. Here is a quick sample to add a custom property to the profile on login:

app.use(auth({
  getUser: (tokenSet) => {
    tokenClaims = tokenSet.claims || {};
    return Object.assign(tokenClaims, { lastLogin: Date() });
  }
}));

@joshcanhelp joshcanhelp added this to the v0.4.0 milestone Sep 26, 2019
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

No branches or pull requests

2 participants