ci: remove prettier and use eslint for formatting
This commit is contained in:
+2
-2
@@ -17,7 +17,7 @@ const getToken = (options) => {
|
||||
|
||||
const authLink = setContext((_, { headers }) => {
|
||||
return getToken()
|
||||
.then((token) => ({
|
||||
.then(token => ({
|
||||
headers: {
|
||||
...headers,
|
||||
authorization: token ? `Bearer ${token}` : ''
|
||||
@@ -43,6 +43,6 @@ const instance = new ApolloClient({
|
||||
}
|
||||
})
|
||||
|
||||
export default function(_, inject) {
|
||||
export default function (_, inject) {
|
||||
inject('apollo', instance)
|
||||
}
|
||||
|
||||
+11
-11
@@ -57,10 +57,10 @@ export const useAuth = (onRedirectCallback: (appState?: any) => void = DEFAULT_R
|
||||
.then(() => {
|
||||
return instance.auth0Client?.then(client => client.getUser())
|
||||
.then((user) => {
|
||||
instance.user.value = user
|
||||
instance.isAuthenticated.value = true
|
||||
instance.error.value = null
|
||||
}
|
||||
instance.user.value = user
|
||||
instance.isAuthenticated.value = true
|
||||
instance.error.value = null
|
||||
}
|
||||
)
|
||||
})
|
||||
.catch((e) => {
|
||||
@@ -83,8 +83,8 @@ export const useAuth = (onRedirectCallback: (appState?: any) => void = DEFAULT_R
|
||||
},
|
||||
/** Returns the access token. If the token is invalid or missing, a new one is retrieved */
|
||||
getTokenSilently: (o: GetTokenSilentlyOptions) => {
|
||||
return instance.auth0Client!.then(client => {
|
||||
return client.getTokenSilently(o).catch(e => {
|
||||
return instance.auth0Client!.then((client) => {
|
||||
return client.getTokenSilently(o).catch((e) => {
|
||||
instance.error.value = e
|
||||
})
|
||||
})
|
||||
@@ -97,19 +97,19 @@ export const useAuth = (onRedirectCallback: (appState?: any) => void = DEFAULT_R
|
||||
|
||||
const fetchUser = () => {
|
||||
return instance.auth0Client!.then(client => client.isAuthenticated())
|
||||
.then(a => {
|
||||
.then((a) => {
|
||||
instance.auth0Client?.then(client => client.getUser()
|
||||
.then(u => {
|
||||
.then((u) => {
|
||||
instance.isAuthenticated.value = a
|
||||
instance.user.value = u
|
||||
instance.error.value = null
|
||||
}))
|
||||
})
|
||||
}
|
||||
// Create a new instance of the SDK client using members of the given options object
|
||||
// Create a new instance of the SDK client using members of the given options object
|
||||
instance.auth0Client = createAuth0Client(options)
|
||||
instance.auth0Client
|
||||
.then(client => {
|
||||
.then((client) => {
|
||||
instance.loading.value = true
|
||||
// If the user is returning to the app after authentication..
|
||||
if (
|
||||
@@ -120,7 +120,7 @@ export const useAuth = (onRedirectCallback: (appState?: any) => void = DEFAULT_R
|
||||
) {
|
||||
// handle the redirect and retrieve tokens
|
||||
return client.handleRedirectCallback()
|
||||
.then(result => {
|
||||
.then((result) => {
|
||||
// Notify subscribers that the redirect callback has happened, passing the appState
|
||||
// (useful for retrieving any pre-authentication state)
|
||||
onRedirectCallback(result.appState)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import { defineNuxtPlugin } from '#app'
|
||||
export default defineNuxtPlugin(({ $pinia }) => {
|
||||
$pinia.use(
|
||||
createPersistedState({
|
||||
key: (id) => `dancefinder_${id}`
|
||||
key: id => `dancefinder_${id}`
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user