Skip to content

Instantly share code, notes, and snippets.

View hbsoftco's full-sized avatar

hossein hbsoftco

View GitHub Profile
@zolotyx
zolotyx / auth.js
Last active March 6, 2023 06:06
Nuxt Auth Redirect Fix
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@\-%_~]*[?]?([^#]*)#?([^#]*)$/.test(u)
export default function ({ app }) {
const redirect = function (name, noRouter = false) {
if (!this.options.redirect) {
return
}