loginsrv

Unnamed repository; edit this file 'description' to name the repository.
git clone git@jamesshield.xyz:repos/loginsrv.git
Log | Files | Refs | README | LICENSE

commit 638efbc235f52c31a189043be76a9dd5a8fc1cc5
parent 3daa252707bab5b8d7b0dc43d6fd6a7ee3bfca49
Author: Gregor Weckbecker <gregor.weckbecker@snabble.io>
Date:   Tue,  5 May 2020 09:30:48 +0200

Merge pull request #122 from huguesalary/master

Remove rightmost "/" from login_path
Diffstat:
Mlogin/login_form.go | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/login/login_form.go b/login/login_form.go @@ -64,7 +64,7 @@ const partials = ` {{define "login"}} {{ range $providerName, $opts := .Config.Oauth }} - <a class="btn btn-block btn-lg btn-social btn-{{ $providerName }}" href="{{ $.Config.LoginPath }}/{{ $providerName }}"> + <a class="btn btn-block btn-lg btn-social btn-{{ $providerName }}" href="{{ trimRight $.Config.LoginPath "/" }}/{{ $providerName }}"> <span class="fa fa-{{ $providerName }}"></span> Sign in with {{ $providerName | ucfirst }} </a> {{end}} @@ -145,7 +145,8 @@ type loginFormData struct { func writeLoginForm(w http.ResponseWriter, params loginFormData) { funcMap := template.FuncMap{ - "ucfirst": ucfirst, + "ucfirst": ucfirst, + "trimRight": strings.TrimRight, } templateName := "loginForm" if params.Config != nil && params.Config.Template != "" {