fix: lint-error

This commit is contained in:
2020-06-21 19:06:41 +02:00
parent 84843cc3ed
commit 27ff91ed0b
6 changed files with 253 additions and 232 deletions
+2 -2
View File
@@ -10,6 +10,7 @@ let instance
const params = new URL(window.location).searchParams
const domain = params.get('domain') || 'unbound.eu.auth0.com'
// eslint-disable-next-line import/prefer-default-export
export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
if (instance) {
return toRefs(instance)
@@ -105,14 +106,12 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
instance.auth0Client = createAuth0Client(options)
instance.auth0Client.then(client => {
instance.loading = true
// instance.auth0Client = client
try {
// If the user is returning to the app after authentication..
if (
window.location.search.includes('code=') &&
window.location.search.includes('state=')
) {
console.log('location search', window.location.search)
// handle the redirect and retrieve tokens
client
.handleRedirectCallback()
@@ -123,6 +122,7 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
// Initialize our internal authentication state
fetchUser()
})
// eslint-disable-next-line no-console
.catch(e => console.error('error handling redirect callback', e))
} else {
fetchUser()