You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am maybe just misdirected by the naming here - Can you call authkitLoader inside a remix action as well? We need to get tokens to call endpoints in our actions and I’m not 100% sure that you can use it in an action.
The text was updated successfully, but these errors were encountered:
Hey there, although authkitLoader isn't technically supposed to be used in Remix actions, there is a workaround to get it doing what you want.
I'm going to leave this issue open as a reminder to add a Remix specific method for getting the user data, but in the meanwhile the following should work:
exportasyncfunctionaction({ request }: ActionFunctionArgs){constresp=awaitauthkitLoader({
request,params: {},context: {},});const{ accessToken }=awaitresp.json();console.log('action:',accessToken);// make follow up API calls with the access token }
The above works because our loader doesn't require either params or context to function, just the request.
I am maybe just misdirected by the naming here - Can you call
authkitLoader
inside a remix action as well? We need to get tokens to call endpoints in our actions and I’m not 100% sure that you can use it in an action.The text was updated successfully, but these errors were encountered: