Skip to content

Commit a37d599

Browse files
hewwpi0
authored andcommitted
fix: fullPathRedirect with query support (#149)
1 parent f7576e3 commit a37d599

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/core/auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export default class Auth {
304304
return
305305
}
306306

307-
const from = this.options.fullPathRedirect ? this.ctx.route.path : this.ctx.route.fullPath
307+
const from = this.options.fullPathRedirect ? this.ctx.route.fullPath : this.ctx.route.path
308308

309309
let to = this.options.redirect[name]
310310
if (!to) {

lib/core/utilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const isSet = o => !isUnset(o)
44
export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0]
55

66
export const isRelativeURL = u =>
7-
u && u.length && /^\/[a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]{1,200}$/.test(u)
7+
u && u.length && /^\/[a-zA-Z0-9@\-%_~][/a-zA-Z0-9@\-%_~]*[\?]?([^\#]*)#?([^\#]*)$/.test(u)
88

99
export const parseQuery = queryString => {
1010
const query = {}

0 commit comments

Comments
 (0)