Skip to content

Commit f4cad4b

Browse files
committed
Add missing url
1 parent fa60e13 commit f4cad4b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/sp/sp.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ func (s *ServiceProvider) AcsURL() *url.URL {
226226
return &s.mw.ServiceProvider.AcsURL
227227
}
228228

229+
func (s *ServiceProvider) LoginUrl() *url.URL {
230+
logout, _ := url.JoinPath(s.root.String(), "/saml/login")
231+
u, _ := url.Parse(logout)
232+
return u
233+
}
234+
229235
func (s *ServiceProvider) LogoutUrl() *url.URL {
230236
logout, _ := url.JoinPath(s.root.String(), "/saml/logout")
231237
u, _ := url.Parse(logout)
@@ -376,7 +382,7 @@ func NewMux(s *ServiceProvider) *http.ServeMux {
376382
mux.HandleFunc(s.LogoutUrl().Path, s.LogoutHandler)
377383

378384
// login endpoint
379-
mux.Handle("/saml/login", s.RequireAccount(http.HandlerFunc(s.HomeHandler)))
385+
mux.Handle(s.LoginUrl().Path, s.RequireAccount(http.HandlerFunc(s.HomeHandler)))
380386

381387
return mux
382388
}

0 commit comments

Comments
 (0)