build: add name to components which failed lint check
This commit is contained in:
+3
-3
@@ -22,13 +22,13 @@ const httpLink = createHttpLink({
|
||||
uri: apiUrl
|
||||
})
|
||||
|
||||
const getToken = async options => {
|
||||
const getToken = async (options) => {
|
||||
const { getTokenSilently } = useAuth()
|
||||
return getTokenSilently.value(options)
|
||||
}
|
||||
|
||||
const authLink = setContext(async (_, { headers }) => {
|
||||
return getToken().then(token => ({
|
||||
return getToken().then((token) => ({
|
||||
headers: {
|
||||
...headers,
|
||||
authorization: token ? `Bearer ${token}` : ''
|
||||
@@ -52,7 +52,7 @@ const instance = new ApolloClient({
|
||||
}
|
||||
})
|
||||
|
||||
export default function ({app}) {
|
||||
export default function ({ app }) {
|
||||
app.setup = () => {
|
||||
provide(DefaultApolloClient, instance)
|
||||
}
|
||||
|
||||
+22
-22
@@ -31,11 +31,11 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
popupOpen: false,
|
||||
error: null,
|
||||
/** Authenticates the user using a popup window */
|
||||
loginWithPopup: async o => {
|
||||
loginWithPopup: async (o) => {
|
||||
this.popupOpen = true
|
||||
|
||||
try {
|
||||
await instance.auth0Client.then(client => client.loginWithPopup(o))
|
||||
await instance.auth0Client.then((client) => client.loginWithPopup(o))
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line
|
||||
console.error(e)
|
||||
@@ -43,7 +43,7 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
instance.popupOpen = false
|
||||
}
|
||||
|
||||
instance.user = await instance.auth0Client.then(client =>
|
||||
instance.user = await instance.auth0Client.then((client) =>
|
||||
client.getUser()
|
||||
)
|
||||
instance.isAuthenticated = true
|
||||
@@ -52,10 +52,10 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
handleRedirectCallback: async () => {
|
||||
instance.loading = true
|
||||
try {
|
||||
await instance.auth0Client.then(client =>
|
||||
await instance.auth0Client.then((client) =>
|
||||
client.handleRedirectCallback()
|
||||
)
|
||||
instance.user = await instance.auth0Client.then(client =>
|
||||
instance.user = await instance.auth0Client.then((client) =>
|
||||
client.getUser()
|
||||
)
|
||||
instance.isAuthenticated = true
|
||||
@@ -66,36 +66,36 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
}
|
||||
},
|
||||
/** Authenticates the user using the redirect method */
|
||||
loginWithRedirect: o => {
|
||||
return instance.auth0Client.then(client => client.loginWithRedirect(o))
|
||||
loginWithRedirect: (o) => {
|
||||
return instance.auth0Client.then((client) => client.loginWithRedirect(o))
|
||||
},
|
||||
/** Returns all the claims present in the ID token */
|
||||
getIdTokenClaims: o => {
|
||||
return instance.auth0Client.then(client => client.getIdTokenClaims(o))
|
||||
getIdTokenClaims: (o) => {
|
||||
return instance.auth0Client.then((client) => client.getIdTokenClaims(o))
|
||||
},
|
||||
/** Returns the access token. If the token is invalid or missing, a new one is retrieved */
|
||||
getTokenSilently: o => {
|
||||
return instance.auth0Client.then(client => {
|
||||
getTokenSilently: (o) => {
|
||||
return instance.auth0Client.then((client) => {
|
||||
return client.getTokenSilently(o)
|
||||
})
|
||||
},
|
||||
/** Gets the access token using a popup window */
|
||||
getTokenWithPopup: o => {
|
||||
return instance.auth0Client.then(client => client.getTokenWithPopup(o))
|
||||
getTokenWithPopup: (o) => {
|
||||
return instance.auth0Client.then((client) => client.getTokenWithPopup(o))
|
||||
},
|
||||
/** Logs the user out and removes their session on the authorization server */
|
||||
logout: o => {
|
||||
return instance.auth0Client.then(client => client.logout(o))
|
||||
logout: (o) => {
|
||||
return instance.auth0Client.then((client) => client.logout(o))
|
||||
}
|
||||
})
|
||||
|
||||
const fetchUser = () => {
|
||||
instance.auth0Client
|
||||
.then(client => client.isAuthenticated())
|
||||
.then(a => {
|
||||
.then((client) => client.isAuthenticated())
|
||||
.then((a) => {
|
||||
instance.isAuthenticated = a
|
||||
instance.auth0Client.then(client =>
|
||||
client.getUser().then(u => {
|
||||
instance.auth0Client.then((client) =>
|
||||
client.getUser().then((u) => {
|
||||
instance.user = u
|
||||
instance.loading = false
|
||||
})
|
||||
@@ -104,7 +104,7 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
}
|
||||
// Create a new instance of the SDK client using members of the given options object
|
||||
instance.auth0Client = createAuth0Client(options)
|
||||
instance.auth0Client.then(client => {
|
||||
instance.auth0Client.then((client) => {
|
||||
instance.loading = true
|
||||
try {
|
||||
// If the user is returning to the app after authentication..
|
||||
@@ -115,7 +115,7 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
// handle the redirect and retrieve tokens
|
||||
client
|
||||
.handleRedirectCallback()
|
||||
.then(appState => {
|
||||
.then((appState) => {
|
||||
// Notify subscribers that the redirect callback has happened, passing the appState
|
||||
// (useful for retrieving any pre-authentication state)
|
||||
onRedirectCallback(appState)
|
||||
@@ -123,7 +123,7 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
fetchUser()
|
||||
})
|
||||
// eslint-disable-next-line no-console
|
||||
.catch(e => console.error('error handling redirect callback', e))
|
||||
.catch((e) => console.error('error handling redirect callback', e))
|
||||
} else {
|
||||
fetchUser()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user