Skip to content

Commit ffda6b0

Browse files
authored
fix(oauth2): use normalized path for callback route check (#587)
1 parent bfc2247 commit ffda6b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/schemes/oauth2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { encodeQuery, parseQuery } from '../utilities'
1+
import { encodeQuery, parseQuery, normalizePath } from '../utilities'
22
import nanoid from 'nanoid'
33
const isHttps = process.server ? require('is-https') : null
44

@@ -132,7 +132,7 @@ export default class Oauth2Scheme {
132132

133133
async _handleCallback (uri) {
134134
// Handle callback only for specified route
135-
if (this.$auth.options.redirect && this.$auth.ctx.route.path !== this.$auth.options.redirect.callback) {
135+
if (this.$auth.options.redirect && normalizePath(this.$auth.ctx.route.path) !== normalizePath(this.$auth.options.redirect.callback)) {
136136
return
137137
}
138138
// Callback flow is not supported in server side

0 commit comments

Comments
 (0)