SohoHouse / nuxt-oauth

Simple OAuth2 integration for your Nuxt app
MIT License
122 stars 27 forks source link

Accessing oauthHost from within fetchUser function #19

Closed col-panic closed 6 years ago

col-panic commented 6 years ago

I have to query the openid authenticated against from within the fetchUser function. Could you please tell me, how to access the oauthHost variable from within this function? The request object passed, does not seem to contain the original host.

col-panic commented 6 years ago

Would a switch of the following line https://github.com/samtgarson/nuxt-oauth/blob/3325254481b31583253d35e54eef34fe8c55db84/lib/handler.js#L85 to

const user = this.req[this.opts.sessionName].user || await this.opts.fetchUser(accessToken, this.req, this.opts) 

be acceptable?