Skip to content

Commit

Permalink
fix(oauth2): use normalized path for callback route check (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatjindal authored Apr 2, 2020
1 parent bfc2247 commit ffda6b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/schemes/oauth2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { encodeQuery, parseQuery } from '../utilities'
import { encodeQuery, parseQuery, normalizePath } from '../utilities'
import nanoid from 'nanoid'
const isHttps = process.server ? require('is-https') : null

Expand Down Expand Up @@ -132,7 +132,7 @@ export default class Oauth2Scheme {

async _handleCallback (uri) {
// Handle callback only for specified route
if (this.$auth.options.redirect && this.$auth.ctx.route.path !== this.$auth.options.redirect.callback) {
if (this.$auth.options.redirect && normalizePath(this.$auth.ctx.route.path) !== normalizePath(this.$auth.options.redirect.callback)) {
return
}
// Callback flow is not supported in server side
Expand Down

1 comment on commit ffda6b0

@whiskas
Copy link

Choose a reason for hiding this comment

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

where is the '../utilities' ?

Please sign in to comment.