Skip to content

Commit 16d5598

Browse files
committed
use stricter redirect check for next() in guards
1 parent c4ff27a commit 16d5598

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/history/base.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,13 @@ export class History {
126126
// next(false) -> abort navigation, ensure current URL
127127
this.ensureURL(true)
128128
abort(to)
129-
} else if (typeof to === 'string' || typeof to === 'object') {
129+
} else if (
130+
typeof to === 'string' ||
131+
(typeof to === 'object' && (
132+
typeof to.path === 'string' ||
133+
typeof to.name === 'string'
134+
))
135+
) {
130136
// next('/') or next({ path: '/' }) -> redirect
131137
abort()
132138
if (typeof to === 'object' && to.replace) {

0 commit comments

Comments
 (0)