Merge pull request #1505 from MarcDufresne/show-login-page
Add option to always display connector selection even if there's only one
This commit is contained in:
@@ -249,7 +249,7 @@ func (s *Server) handleAuthorization(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
if len(connectors) == 1 {
|
||||
if len(connectors) == 1 && !s.alwaysShowLogin {
|
||||
for _, c := range connectors {
|
||||
// TODO(ericchiang): Make this pass on r.URL.RawQuery and let something latter
|
||||
// on create the auth request.
|
||||
|
@@ -68,6 +68,9 @@ type Config struct {
|
||||
// Logging in implies approval.
|
||||
SkipApprovalScreen bool
|
||||
|
||||
// If enabled, the connectors selection page will always be shown even if there's only one
|
||||
AlwaysShowLoginScreen bool
|
||||
|
||||
RotateKeysAfter time.Duration // Defaults to 6 hours.
|
||||
IDTokensValidFor time.Duration // Defaults to 24 hours
|
||||
AuthRequestsValidFor time.Duration // Defaults to 24 hours
|
||||
@@ -137,6 +140,9 @@ type Server struct {
|
||||
// If enabled, don't prompt user for approval after logging in through connector.
|
||||
skipApproval bool
|
||||
|
||||
// If enabled, show the connector selection screen even if there's only one
|
||||
alwaysShowLogin bool
|
||||
|
||||
supportedResponseTypes map[string]bool
|
||||
|
||||
now func() time.Time
|
||||
@@ -205,6 +211,7 @@ func newServer(ctx context.Context, c Config, rotationStrategy rotationStrategy)
|
||||
idTokensValidFor: value(c.IDTokensValidFor, 24*time.Hour),
|
||||
authRequestsValidFor: value(c.AuthRequestsValidFor, 24*time.Hour),
|
||||
skipApproval: c.SkipApprovalScreen,
|
||||
alwaysShowLogin: c.AlwaysShowLoginScreen,
|
||||
now: now,
|
||||
templates: tmpls,
|
||||
logger: c.Logger,
|
||||
|
Reference in New Issue
Block a user