mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	
							
								
								
									
										11
									
								
								cmd/admin.go
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								cmd/admin.go
									
									
									
									
									
								
							@@ -308,6 +308,11 @@ var (
 | 
			
		||||
			Value: "false",
 | 
			
		||||
			Usage: "Use custom URLs for GitLab/GitHub OAuth endpoints",
 | 
			
		||||
		},
 | 
			
		||||
		cli.StringFlag{
 | 
			
		||||
			Name:  "custom-tenant-id",
 | 
			
		||||
			Value: "",
 | 
			
		||||
			Usage: "Use custom Tenant ID for OAuth endpoints",
 | 
			
		||||
		},
 | 
			
		||||
		cli.StringFlag{
 | 
			
		||||
			Name:  "custom-auth-url",
 | 
			
		||||
			Value: "",
 | 
			
		||||
@@ -829,6 +834,7 @@ func parseOAuth2Config(c *cli.Context) *oauth2.Source {
 | 
			
		||||
			AuthURL:    c.String("custom-auth-url"),
 | 
			
		||||
			ProfileURL: c.String("custom-profile-url"),
 | 
			
		||||
			EmailURL:   c.String("custom-email-url"),
 | 
			
		||||
			Tenant:     c.String("custom-tenant-id"),
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		customURLMapping = nil
 | 
			
		||||
@@ -938,6 +944,7 @@ func runUpdateOauth(c *cli.Context) error {
 | 
			
		||||
		customURLMapping.AuthURL = oAuth2Config.CustomURLMapping.AuthURL
 | 
			
		||||
		customURLMapping.ProfileURL = oAuth2Config.CustomURLMapping.ProfileURL
 | 
			
		||||
		customURLMapping.EmailURL = oAuth2Config.CustomURLMapping.EmailURL
 | 
			
		||||
		customURLMapping.Tenant = oAuth2Config.CustomURLMapping.Tenant
 | 
			
		||||
	}
 | 
			
		||||
	if c.IsSet("use-custom-urls") && c.IsSet("custom-token-url") {
 | 
			
		||||
		customURLMapping.TokenURL = c.String("custom-token-url")
 | 
			
		||||
@@ -955,6 +962,10 @@ func runUpdateOauth(c *cli.Context) error {
 | 
			
		||||
		customURLMapping.EmailURL = c.String("custom-email-url")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if c.IsSet("use-custom-urls") && c.IsSet("custom-tenant-id") {
 | 
			
		||||
		customURLMapping.Tenant = c.String("custom-tenant-id")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	oAuth2Config.CustomURLMapping = customURLMapping
 | 
			
		||||
	source.Cfg = oAuth2Config
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user