Merge pull request #28 from bayer-int/feature/fix-production-authentication

fix:https routing and pr creation.
This commit is contained in:
Nirmal Arya
2025-06-16 22:08:29 -04:00
committed by GitHub
2 changed files with 13 additions and 2 deletions

View File

@@ -7,6 +7,12 @@ on:
paths-ignore:
- 'k8s/**'
workflow_dispatch: # Allows manual triggering
inputs:
create_deployment_pr:
description: 'Create PR for Kubernetes deployment update'
required: false
default: 'true'
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -176,7 +182,7 @@ jobs:
# Create PR for Kubernetes manifests update (for main and dev branches)
- name: Create PR for Kubernetes updates
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_deployment_pr == 'true')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |

View File

@@ -78,7 +78,12 @@ export async function action({ request, context }: ActionFunctionArgs) {
// Get the callback URL
const url = new URL(request.url);
const callbackUrl = `${url.origin}/auth/callback`;
// In production with ingress/load balancer, force HTTPS for callback URL
let callbackUrl = `${url.origin}/auth/callback`;
if (url.hostname.includes('phexhub-np.int.bayer.com')) {
callbackUrl = `https://${url.hostname}/auth/callback`;
}
// Generate authorization URL
const { url: authorizationUrl } = getAuthorizationUrl(state, callbackUrl, context);