mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Don't init singing keys if oauth2 provider disabled (#32177)
Backport #32148
This commit is contained in:
		@@ -30,10 +30,14 @@ const ProviderHeaderKey = "gitea-oauth2-provider"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Init initializes the oauth source
 | 
					// Init initializes the oauth source
 | 
				
			||||||
func Init(ctx context.Context) error {
 | 
					func Init(ctx context.Context) error {
 | 
				
			||||||
	if err := InitSigningKey(); err != nil {
 | 
						// this is for oauth2 provider
 | 
				
			||||||
		return err
 | 
						if setting.OAuth2.Enabled {
 | 
				
			||||||
 | 
							if err := InitSigningKey(); err != nil {
 | 
				
			||||||
 | 
								return err
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// others for oauth2 clients
 | 
				
			||||||
	// Lock our mutex
 | 
						// Lock our mutex
 | 
				
			||||||
	gothRWMutex.Lock()
 | 
						gothRWMutex.Lock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user