mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Fix oauth2 auth and UI (#33961)
This commit is contained in:
		@@ -249,7 +249,7 @@ func AuthorizeOAuth(ctx *context.Context) {
 | 
				
			|||||||
			}, form.RedirectURI)
 | 
								}, form.RedirectURI)
 | 
				
			||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if err := ctx.Session.Set("CodeChallengeMethod", form.CodeChallenge); err != nil {
 | 
							if err := ctx.Session.Set("CodeChallenge", form.CodeChallenge); err != nil {
 | 
				
			||||||
			handleAuthorizeError(ctx, AuthorizeError{
 | 
								handleAuthorizeError(ctx, AuthorizeError{
 | 
				
			||||||
				ErrorCode:        ErrorCodeServerError,
 | 
									ErrorCode:        ErrorCodeServerError,
 | 
				
			||||||
				ErrorDescription: "cannot set code challenge",
 | 
									ErrorDescription: "cannot set code challenge",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,7 +1,6 @@
 | 
				
			|||||||
{{template "base/head" .}}
 | 
					{{template "base/head" .}}
 | 
				
			||||||
<div role="main" aria-label="{{.Title}}" class="page-content ui one column stackable tw-text-center page grid oauth2-authorize-application-box">
 | 
					<div role="main" aria-label="{{.Title}}" class="page-content oauth2-authorize-application-box">
 | 
				
			||||||
	<div class="column seven wide">
 | 
						<div class="ui container tw-max-w-[500px]">
 | 
				
			||||||
		<div class="ui middle centered raised segments">
 | 
					 | 
				
			||||||
		<h3 class="ui top attached header">
 | 
							<h3 class="ui top attached header">
 | 
				
			||||||
			{{ctx.Locale.Tr "auth.authorize_title" .Application.Name}}
 | 
								{{ctx.Locale.Tr "auth.authorize_title" .Application.Name}}
 | 
				
			||||||
		</h3>
 | 
							</h3>
 | 
				
			||||||
@@ -18,7 +17,7 @@
 | 
				
			|||||||
		<div class="ui attached segment">
 | 
							<div class="ui attached segment">
 | 
				
			||||||
			<p>{{ctx.Locale.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML}}</p>
 | 
								<p>{{ctx.Locale.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML}}</p>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
			<div class="ui attached segment">
 | 
							<div class="ui attached segment tw-text-center">
 | 
				
			||||||
			<form method="post" action="{{AppSubUrl}}/login/oauth/grant">
 | 
								<form method="post" action="{{AppSubUrl}}/login/oauth/grant">
 | 
				
			||||||
				{{.CsrfTokenHtml}}
 | 
									{{.CsrfTokenHtml}}
 | 
				
			||||||
				<input type="hidden" name="client_id" value="{{.Application.ClientID}}">
 | 
									<input type="hidden" name="client_id" value="{{.Application.ClientID}}">
 | 
				
			||||||
@@ -32,5 +31,4 @@
 | 
				
			|||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
</div>
 | 
					 | 
				
			||||||
{{template "base/footer" .}}
 | 
					{{template "base/footer" .}}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,6 @@
 | 
				
			|||||||
{{template "base/head" .}}
 | 
					{{template "base/head" .}}
 | 
				
			||||||
<div role="main" aria-label="{{.Title}}" class="page-content ui one column stackable tw-text-center page grid oauth2-authorize-application-box {{if .IsRepo}}repository{{end}}">
 | 
					<div role="main" aria-label="{{.Title}}" class="page-content oauth2-authorize-application-box">
 | 
				
			||||||
	{{if .IsRepo}}{{template "repo/header" .}}{{end}}
 | 
						<div class="ui container tw-max-w-[500px]">
 | 
				
			||||||
	<div class="column seven wide">
 | 
					 | 
				
			||||||
		<div class="ui middle centered raised segments">
 | 
					 | 
				
			||||||
		<h1 class="ui top attached header">
 | 
							<h1 class="ui top attached header">
 | 
				
			||||||
			{{ctx.Locale.Tr "auth.authorization_failed"}}
 | 
								{{ctx.Locale.Tr "auth.authorization_failed"}}
 | 
				
			||||||
		</h1>
 | 
							</h1>
 | 
				
			||||||
@@ -12,5 +10,4 @@
 | 
				
			|||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
</div>
 | 
					 | 
				
			||||||
{{template "base/footer" .}}
 | 
					{{template "base/footer" .}}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user