nuxt-alt / auth

An alternative module to @nuxtjs/auth
https://nuxt-alt-auth.vercel.app/
MIT License
96 stars 20 forks source link

Empty hash in handleCallback in OAuth2 scheme #39

Closed odyniec closed 1 year ago

odyniec commented 1 year ago

In line 358 of oauth2.ts, it looks like getQuery() can't parse route.hash. The resulting hash is an empty object. It seems getQuery() only parses queries starting with ?, as I was able to check with a simple test:

const query1 = "?foo=bar&baz=xyzzy"
console.log(getQuery(query1)) // { foo: 'bar', baz: 'xyzzy' }
console.log(getQuery(query1.slice(1))) // {}

const query2 = "#foo=bar&baz=xyzzy"
console.log(getQuery(query2)) // {}
console.log(getQuery(query2.slice(1))) // {}

parseQuery() on the other hand seems to work -- so maybe oauth2.ts just needs the same treatment as openIDConnect.ts got here?