@@ -80,6 +80,7 @@ type discovery struct {
8080 UserInfo string `json:"userinfo_endpoint"`
8181 DeviceEndpoint string `json:"device_authorization_endpoint"`
8282 Introspect string `json:"introspection_endpoint"`
83+ Registration string `json:"registration_endpoint"`
8384 GrantTypes []string `json:"grant_types_supported"`
8485 ResponseTypes []string `json:"response_types_supported"`
8586 Subjects []string `json:"subject_types_supported"`
@@ -114,6 +115,7 @@ func (s *Server) constructDiscovery() discovery {
114115 UserInfo : s .absURL ("/userinfo" ),
115116 DeviceEndpoint : s .absURL ("/device/code" ),
116117 Introspect : s .absURL ("/token/introspect" ),
118+ Registration : s .absURL ("/register" ),
117119 Subjects : []string {"public" },
118120 IDTokenAlgs : []string {string (jose .RS256 )},
119121 CodeChallengeAlgs : []string {codeChallengeMethodS256 , codeChallengeMethodPlain },
@@ -190,7 +192,7 @@ func (s *Server) handleAuthorization(w http.ResponseWriter, r *http.Request) {
190192 }
191193 }
192194
193- if err := s .templates .login (r , w , connectorInfos ); err != nil {
195+ if err := s .templates .login (r , w , connectorInfos , s . enableSignup ); err != nil {
194196 s .logger .ErrorContext (r .Context (), "server template error" , "err" , err )
195197 }
196198}
@@ -363,7 +365,7 @@ func (s *Server) handlePasswordLogin(w http.ResponseWriter, r *http.Request) {
363365
364366 switch r .Method {
365367 case http .MethodGet :
366- if err := s .templates .password (r , w , r .URL .String (), "" , usernamePrompt (pwConn ), false , backLink ); err != nil {
368+ if err := s .templates .password (r , w , r .URL .String (), "" , usernamePrompt (pwConn ), false , backLink , s . enableSignup ); err != nil {
367369 s .logger .ErrorContext (r .Context (), "server template error" , "err" , err )
368370 }
369371 case http .MethodPost :
@@ -378,7 +380,7 @@ func (s *Server) handlePasswordLogin(w http.ResponseWriter, r *http.Request) {
378380 return
379381 }
380382 if ! ok {
381- if err := s .templates .password (r , w , r .URL .String (), username , usernamePrompt (pwConn ), true , backLink ); err != nil {
383+ if err := s .templates .password (r , w , r .URL .String (), username , usernamePrompt (pwConn ), true , backLink , s . enableSignup ); err != nil {
382384 s .logger .ErrorContext (r .Context (), "server template error" , "err" , err )
383385 }
384386 s .logger .ErrorContext (r .Context (), "failed login attempt: Invalid credentials." , "user" , username )
0 commit comments