mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Integrate OAuth2 Provider (#5378)
This commit is contained in:
		
				
					committed by
					
						 techknowlogick
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							9d3732dfd5
						
					
				
				
					commit
					e777c6bdc6
				
			| @@ -257,6 +257,14 @@ func RegisterRoutes(m *macaron.Macaron) { | ||||
| 		}) | ||||
| 	}, reqSignOut) | ||||
|  | ||||
| 	m.Group("/login/oauth", func() { | ||||
| 		m.Get("/authorize", bindIgnErr(auth.AuthorizationForm{}), user.AuthorizeOAuth) | ||||
| 		m.Post("/grant", bindIgnErr(auth.GrantApplicationForm{}), user.GrantApplicationOAuth) | ||||
| 		// TODO manage redirection | ||||
| 		m.Post("/authorize", bindIgnErr(auth.AuthorizationForm{}), user.AuthorizeOAuth) | ||||
| 	}, ignSignInAndCsrf, reqSignIn) | ||||
| 	m.Post("/login/oauth/access_token", bindIgnErr(auth.AccessTokenForm{}), ignSignInAndCsrf, user.AccessTokenOAuth) | ||||
|  | ||||
| 	m.Group("/user/settings", func() { | ||||
| 		m.Get("", userSetting.Profile) | ||||
| 		m.Post("", bindIgnErr(auth.UpdateProfileForm{}), userSetting.ProfilePost) | ||||
| @@ -291,6 +299,12 @@ func RegisterRoutes(m *macaron.Macaron) { | ||||
| 			}, openIDSignInEnabled) | ||||
| 			m.Post("/account_link", userSetting.DeleteAccountLink) | ||||
| 		}) | ||||
| 		m.Group("/applications/oauth2", func() { | ||||
| 			m.Get("/:id", userSetting.OAuth2ApplicationShow) | ||||
| 			m.Post("/:id", bindIgnErr(auth.EditOAuth2ApplicationForm{}), userSetting.OAuthApplicationsEdit) | ||||
| 			m.Post("", bindIgnErr(auth.EditOAuth2ApplicationForm{}), userSetting.OAuthApplicationsPost) | ||||
| 			m.Post("/delete", userSetting.DeleteOAuth2Application) | ||||
| 		}) | ||||
| 		m.Combo("/applications").Get(userSetting.Applications). | ||||
| 			Post(bindIgnErr(auth.NewAccessTokenForm{}), userSetting.ApplicationsPost) | ||||
| 		m.Post("/applications/delete", userSetting.DeleteApplication) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user