Next.js Discord

Discord Forum

http auth with cron-job.org

Unanswered
alexandrechs posted this in #help-forum
Open in Discord
Hi everybody !

I'm using nextJS 13 and i have a route in my /api backend. I want to secure my route so no one can call it other than my app. I test with cron-job.org, free cron manager.

I can add an http auth with my cron and adding an username and password. How can i implemente that in my app after ? I don't know, if somebody can help me a little..

I send a screen of all possibility :

Thanks ♥

8 Replies

help
what do you mean by my app ?
you should not trust 100% cron-job.com or something. especially it is free, your api-key could be exposed. just open one endpoint with an api-key with IP filter if they have.
use Auth.js if my app means the Next.js app.
my app : The website i create with nextJS 13 haha.

Hmm okay, but if i can't use a free cron, how can i setup a cron each hour to call an endpoint ? Vercel propose some cron, but is not free.. i saw mergent have free cron per month too
yeah it’s trade off. it’s your call.
You think mergent is better ? 1000 cron each month, i need around 800 each month ^^
thx for helping, have a good day