Implement oidc client of sorts

This commit is contained in:
Maximilian Friedersdorff 2025-12-10 16:34:40 +00:00
parent 1772e57ee8
commit a750f646a9
7 changed files with 175 additions and 55 deletions

View file

@ -60,6 +60,14 @@ type Config struct {
NotesDir string
LogAccess bool
Production bool
OIDC struct {
ClientID string `toml:"client_id"`
ClientSecret string `toml:"client_secret"`
AuthURL string `toml:"auth_url"`
TokenURL string `toml:"token_url"`
RedirectURL string `toml:"redirect_url"`
UserinfoURL string `toml:"userinfo_url"`
}
}
var (

View file

@ -62,9 +62,15 @@
</ul>
</li>
{{template "navLinks" .}}
{{if eq .user "anon"}}
<li>
<a class="nav-link" href="/auth/oauth/login/">Login</a>
</li>
{{else}}
<li>
<a class="nav-link" href="/logout/">Logout {{.user}}</a>
</li>
{{end}}
</ul>
{{template "navExtra" .}}
</div>