Skip to content

Commit

Permalink
fix: fullPathRedirect with query support (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
heww authored and pi0 committed Apr 20, 2018
1 parent f7576e3 commit a37d599
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/core/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export default class Auth {
return
}

const from = this.options.fullPathRedirect ? this.ctx.route.path : this.ctx.route.fullPath
const from = this.options.fullPathRedirect ? this.ctx.route.fullPath : this.ctx.route.path

let to = this.options.redirect[name]
if (!to) {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const isSet = o => !isUnset(o)
export const isSameURL = (a, b) => a.split('?')[0] === b.split('?')[0]

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

export const parseQuery = queryString => {
const query = {}
Expand Down

0 comments on commit a37d599

Please sign in to comment.