feat(auth): Configure Authentik OIDC integration with better-auth
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

- Add genericOAuth plugin to auth.config.ts with Authentik provider
- Fix LoginButton to use /auth/signin/authentik (not /auth/callback/)
- Add production URLs to trustedOrigins
- Update .env.example with correct redirect URI documentation

Redirect URI for Authentik: https://api.mosaicstack.dev/auth/callback/authentik

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 18:11:32 -06:00
parent f2b25079d9
commit cb0948214e
4 changed files with 23 additions and 6 deletions

View File

@@ -32,9 +32,7 @@ describe("LoginButton", (): void => {
const button = screen.getByRole("button", { name: /sign in/i });
await user.click(button);
expect(mockLocation.assign).toHaveBeenCalledWith(
"http://localhost:3001/auth/callback/authentik"
);
expect(mockLocation.assign).toHaveBeenCalledWith("http://localhost:3001/auth/signin/authentik");
});
it("should have proper styling", (): void => {

View File

@@ -8,7 +8,7 @@ export function LoginButton(): React.JSX.Element {
const handleLogin = (): void => {
// Redirect to the backend OIDC authentication endpoint
// BetterAuth will handle the OIDC flow and redirect back to the callback
window.location.assign(`${API_URL}/auth/callback/authentik`);
window.location.assign(`${API_URL}/auth/signin/authentik`);
};
return (