#How can I authenticate a static docs site?

4 messages · Page 1 of 1 (latest)

simple talon
#

I've been tasked with creating a docs site which needs to be under authentication, ideally from the main Laravel site.

Here's my plan but i'm open to ideas, I created static site using Astro Starlight which builds down to plain html and would be hosted on a subdomain.

Is it possible to convert HTML to php and check the session token simply? Alternatively, could the HTML files live within the main Laravel app and called as views?

I had considered building a 2nd Laraval app for this but dealing with hundreds of markdown files, Starlight is really convenient and fast to build a static site with search.

glossy crag
#

You can just rename a html file to .blade.php and use it as a view.

#

Regarding auth, if the session has to work on both maindomain.com and sub.maindomain.com you have to set the session cookie's domain to .maindomain.com (the leading period is important).

#

I think you'll find it easier to just serve the docs subdomain from the same app. Getting session auth to work on a separate site is possible, but it's usually done with SPA sites via Sanctum. I don't know how you'd do it with a static site.