fix: corrige problema completo de :443 em OAuth redirect URLs
All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 2s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 15m23s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 1m58s
BCards Deployment Pipeline / Deploy to Test (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s
All checks were successful
BCards Deployment Pipeline / Run Tests (push) Successful in 2s
BCards Deployment Pipeline / PR Validation (push) Has been skipped
BCards Deployment Pipeline / Build and Push Image (push) Successful in 15m23s
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (push) Successful in 1m58s
BCards Deployment Pipeline / Deploy to Test (x86 - Local) (push) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (push) Has been skipped
BCards Deployment Pipeline / Deployment Summary (push) Successful in 0s
- Adiciona fix para Microsoft OAuth (mesmo que Google) - Remove especificação explícita de porta 443 no HostString - Resolve CORS errors causados por porta explícita nos redirect URIs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1caac8d7fb
commit
1d80b48a81
@ -351,9 +351,16 @@ authBuilder.AddGoogle(options =>
|
|||||||
|
|
||||||
var originalUri = context.RedirectUri;
|
var originalUri = context.RedirectUri;
|
||||||
|
|
||||||
|
// Fix para Cloudflare - remover porta 443 explícita (mesmo fix do Google)
|
||||||
|
if (!builder.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
context.RedirectUri = originalUri.Replace(":443", "");
|
||||||
|
logger.LogWarning($"REMOVED :443 - Modified RedirectUri: {context.RedirectUri}");
|
||||||
|
}
|
||||||
|
|
||||||
if (originalUri.Contains("bcards.site"))
|
if (originalUri.Contains("bcards.site"))
|
||||||
{
|
{
|
||||||
context.RedirectUri = originalUri
|
context.RedirectUri = context.RedirectUri
|
||||||
.Replace("http://bcards.site", "https://bcards.site")
|
.Replace("http://bcards.site", "https://bcards.site")
|
||||||
.Replace("http%3A%2F%2Fbcards.site", "https%3A%2F%2Fbcards.site");
|
.Replace("http%3A%2F%2Fbcards.site", "https%3A%2F%2Fbcards.site");
|
||||||
|
|
||||||
@ -522,7 +529,8 @@ if (!app.Environment.IsDevelopment())
|
|||||||
|
|
||||||
if (context.Request.Host.Host == "bcards.site")
|
if (context.Request.Host.Host == "bcards.site")
|
||||||
{
|
{
|
||||||
context.Request.Host = new HostString("bcards.site", 443);
|
// Fix para Cloudflare - não especificar porta explícita
|
||||||
|
context.Request.Host = new HostString("bcards.site");
|
||||||
}
|
}
|
||||||
|
|
||||||
await next();
|
await next();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user