Nazvix
KKinde
•Created by Mert Efe Cerit on 12/9/2024 in #💻┃support
/api/login route cannot found on build (NUXT)
Okay, I got the solution. Turns out the only think that works for me is using Github Action env on build stage. For anyone that has the same problems
- Check if the env name variables in local, preview, and production is the same
- Check if the value in production within Github Action and Cloudflare matches
- Check if the kinde is integrated and the API from kinde is exposed, you can do this by turn on OpenAPI experimental feature in Nuxt Config nitro: { experimental: { openAPI: true } }. This will make the API routes appeared in Nuxt Hub Dashboard. If the api routes from kinde such as /api/login, /api/register exists, then it is integrated
- Make sure you didnt create any files that has name/route that conflicted with Kinde api route
- Turn on Kinde debug feature on Nuxt Config by using kinde: { debug: true }
- Check if the values in the env propagated to kinde, by doing health check to /api/health
- If the value is not propagated, try to use kind config in Nuxt config, such as kinde: {
authDomain: process.env.NUXT_KINDE_AUTH_DOMAIN,
clientId: process.env.NUXT_KINDE_CLIENT_ID,
clientSecret: process.env.NUXT_KINDE_CLIENT_SECRET,
...
}
- If kinde value doesnt work and it's still not propagated, try to use the Nuxt Config instead
- If it's still doesnt work, try to use Nuxt Config public on public: { ... } instead
- If it's still doesnt work, try to modify the nuxthub.yml workflow, in the build stage (npm run build) add env paramater using Github Actions Secrets and Variables, such as
env:
NUXT_KINDE_CLIENT_ID: ${{ secrets.NUXT_KINDE_CLIENT_ID }}
NUXT_KINDE_CLIENT_SECRET: ${{ secrets.NUXT_KINDE_CLIENT_SECRET }}
NUXT_KINDE_PASSWORD: ${{ secrets.NUXT_KINDE_PASSWORD }}
NUXT_KINDE_AUTH_DOMAIN: ${{ vars.NUXT_KINDE_AUTH_DOMAIN }}
...
- Make sure the callback is using Kinde /api/callback (I have no idea why I cant use my own callback, too many errors, essentially gave up lmao. Probably skill issue)
21 replies
KKinde
•Created by Mert Efe Cerit on 12/9/2024 in #💻┃support
/api/login route cannot found on build (NUXT)
Hello, I have exactly the same problem, deployed on nuxt hub and instantly cant access the auth. What's the solution again? The env is propagated to the production yet it still throws error
21 replies