Closed xtractalpha closed 1 year ago
I've found the solution. Silly me!
It was quite straightforward.
For anyone else facing the same challenge, just set up a file server, and you're good to go!
handle_path /_next* {
authorize with mypolicy
root * /etc/caddy/auth/local/templates/_next/
file_server
}
@xtractalpha , could you please write a testimonial for your use of the project? Please see https://docs.authcrunch.com/help-needed for details.
@xtractalpha , also, if you still use custom js path
, please share your code for reference.
Hi!
Big thanks to @greenpau for all the hard work!
I have a question. I want to use a custom template made with Next.JS.
I watched your video (link below), which is great, but it doesn't fit my situation. I need to add many JavaScript files, as shown in the directory below.
I know I can add individual JavaScript files like this:
But I think this won't work for me because it doesn't keep the folder structure, right?
So, I thought about adding the whole folder to my Docker container and keeping the links to the JavaScript files the same as in the original HTML.
In the Caddyfile, I set:
template login /etc/caddy/auth/local/templates/login.html
But when I visit the URL, the page has no CSS or JavaScript.
The logs show 302 errors for the CSS and JavaScript files. I guess it's because I'm not logged in, so all requests go to the /auth URL.
I know that I can bypass authorization for specific URIs, but I don't know if that is a good practice...
What should I do in this situation?
Directory:
Video link: https://www.youtube.com/watch?v=20XOn-RBIX0