diff --git a/components/pages/events/index.vue b/components/pages/events/index.vue index 9f1e5d2..a81ccc3 100644 --- a/components/pages/events/index.vue +++ b/components/pages/events/index.vue @@ -1,10 +1,10 @@ diff --git a/components/pages/filters/index.vue b/components/pages/filters/index.vue index dfa08d9..a88ea6c 100644 --- a/components/pages/filters/index.vue +++ b/components/pages/filters/index.vue @@ -59,6 +59,7 @@ diff --git a/nuxt.config.js b/nuxt.config.js index c150254..6666731 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -18,9 +18,7 @@ export default { } } }, - buildModules: [ - 'nuxt-composition-api' - ], + buildModules: ['nuxt-composition-api'], css: ['vuetify/dist/vuetify.css', '~/assets/scss/global.scss'], env: { graphqlApi: process.env.GRAPHQL_API diff --git a/plugins/apollo.js b/plugins/apollo.js index 5d557a4..117ccd7 100644 --- a/plugins/apollo.js +++ b/plugins/apollo.js @@ -1,13 +1,16 @@ import { ApolloClient } from 'apollo-client' -import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory' +import { + InMemoryCache, + IntrospectionFragmentMatcher +} from 'apollo-cache-inmemory' import { createHttpLink } from 'apollo-link-http' import { setContext } from 'apollo-link-context' -import { useAuth } from './auth' import { provide } from '@vue/composition-api' -import introspectionQueryResultData from '../fragmentTypes.json' import { onGlobalSetup } from 'nuxt-composition-api' import { DefaultApolloClient } from '@vue/apollo-composable' import Vue from 'vue' +import introspectionQueryResultData from '../fragmentTypes.json' +import { useAuth } from './auth' const apiUrl = process.env.graphqlApi || '/query' @@ -21,7 +24,7 @@ const httpLink = createHttpLink({ uri: apiUrl }) -const getToken = async (options) => { +const getToken = async options => { const { getTokenSilently } = useAuth() return getTokenSilently.value(options) } diff --git a/plugins/auth.js b/plugins/auth.js index 2922ccb..843b9a2 100644 --- a/plugins/auth.js +++ b/plugins/auth.js @@ -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()