feat: redirect to requested page after login, solves #281

This commit is contained in:
Christoph Kluge
2024-11-26 16:21:16 +01:00
parent e1be6c7138
commit 38ce40ae7d
5 changed files with 18 additions and 15 deletions

View File

@@ -41,6 +41,7 @@
{{- if .Infos.hasOpenIDConnect}}
<a class="btn btn-primary" href="/oidc-login">OpenID Connect Login</a>
{{end}}
<input type="hidden" id="redirect" name="redirect" value="{{ .Redirect }}" />
</form>
</div>
</div>

View File

@@ -99,6 +99,7 @@ type Page struct {
Infos map[string]interface{} // For generic use (e.g. username for /monitoring/user/<id>, job id for /monitoring/job/<id>)
Config map[string]interface{} // UI settings for the currently logged in user (e.g. line width, ...)
Resampling *schema.ResampleConfig // If not nil, defines resampling trigger and resolutions
Redirect string // The originally requested URL, for intermediate login handling
}
func RenderTemplate(rw http.ResponseWriter, file string, page *Page) {