Skip to content

🐛 fix(Root): defer auth cookie check to useEffect after actor initialization#89

Merged
bitbacchus merged 2 commits intomainfrom
feature/root-auth-redirect-useEffect
Jun 10, 2025
Merged

🐛 fix(Root): defer auth cookie check to useEffect after actor initialization#89
bitbacchus merged 2 commits intomainfrom
feature/root-auth-redirect-useEffect

Conversation

@bitbacchus
Copy link
Member

  • Move the inline cookie("bearer")navigate("/") redirect out of the render path
  • Perform the login‐redirect in a useEffect that runs once after init.isValue
  • Prevents spurious redirects on re‐renders (e.g. when using React DevTools “pause”)

* Hotfix Can only click on stats detaiils when availible (#85)

* update dependencies

* adds loading spinner to dashboard

* Hotfix: Stats details can only be clicked when stats avail.

* Revert "Hotfix Can only click on stats detaiils when availible (#85)" (#86)

This reverts commit 80a01a1.

* Delete .github/workflows/deploy-check.yml

Updated for Docker deployment

Logrotate function explicitly returns 0 now.

* 🔒 Improve token handling in TokenActor: retry on failure and clear previous timeout (#87)

* Update deploy-test.yml

* Version 1.6.2
…ization

- Move the inline  →  redirect out of the render path
- Perform the login‐redirect in a  that runs once after
- Prevents spurious redirects on re‐renders (e.g. when using React DevTools “pause”)
@bitbacchus bitbacchus self-assigned this Jun 10, 2025
Comment on lines +12 to +33
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.ref_name }}

steps:
- name: Set up SSH agent
uses: webfactory/ssh-agent@v0.7.0
with:
ssh-private-key: ${{ secrets.TEST_SSH_PRIVATE_KEY }}

- name: Add test server to known_hosts
run: |
mkdir -p ~/.ssh
echo "${{ secrets.TEST_SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts

- name: Deploy ${{ env.BRANCH_NAME }} to test server
run: |
echo "➡️ Starting remote deployment of branch '${BRANCH_NAME}'"
ssh -o StrictHostKeyChecking=no \
${{ secrets.TEST_SERVER_USER }}@${{ secrets.TEST_SERVER_HOST }} \
"bash ~/deploy_recapp_to_test.sh \"${BRANCH_NAME}\""
echo "✅ Remote deployment of branch '${BRANCH_NAME}' succeeded"

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 9 months ago

To fix the issue, we need to add a permissions block to the workflow. Since the workflow does not interact with the repository contents or require write access, we can set the permissions to contents: read, which is the minimal privilege required for most workflows. This ensures that the GITHUB_TOKEN has restricted access and adheres to the principle of least privilege.

The permissions block should be added at the root level of the workflow file, so it applies to all jobs in the workflow.

Suggested changeset 1
.github/workflows/deploy-test.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/deploy-test.yml b/.github/workflows/deploy-test.yml
--- a/.github/workflows/deploy-test.yml
+++ b/.github/workflows/deploy-test.yml
@@ -2,2 +2,5 @@
 
+permissions:
+  contents: read
+
 on:
EOF
@@ -2,2 +2,5 @@

permissions:
contents: read

on:
Copilot is powered by AI and may make mistakes. Always verify output.
@bitbacchus bitbacchus merged commit 74cc217 into main Jun 10, 2025
4 checks passed
@bitbacchus bitbacchus deleted the feature/root-auth-redirect-useEffect branch June 10, 2025 21:12
bitbacchus added a commit that referenced this pull request Jun 11, 2025
* Hotfix Can only click on stats detaiils when availible (#85)

* update dependencies

* adds loading spinner to dashboard

* Hotfix: Stats details can only be clicked when stats avail.

* Revert "Hotfix Can only click on stats detaiils when availible (#85)" (#86)

This reverts commit 80a01a1.

* Create deploy-test.yml

* Update deploy-test.yml

* Update deploy-test.yml

* Update deploy-test.yml

* Delete .github/workflows/deploy-check.yml

* Update deployment.sh

Updated for Docker deployment

* Update deployment.sh

Logrotate function explicitly returns 0 now.

* 🔒 Improve token handling in TokenActor: retry on failure and clear previous timeout (#87)

* Update deploy-test.yml

* Update deploy-test.yml

* Update deployment.sh

* Version 1.6.2

* version 1.6.2

* 🐛 fix(Root): defer auth cookie check to useEffect after actor initialization (#89)

* PR version 1.6.2 (#88)

* Hotfix Can only click on stats detaiils when availible (#85)

* update dependencies

* adds loading spinner to dashboard

* Hotfix: Stats details can only be clicked when stats avail.

* Revert "Hotfix Can only click on stats detaiils when availible (#85)" (#86)

This reverts commit 80a01a1.

* Delete .github/workflows/deploy-check.yml

Updated for Docker deployment

Logrotate function explicitly returns 0 now.

* 🔒 Improve token handling in TokenActor: retry on failure and clear previous timeout (#87)

* Update deploy-test.yml

* Version 1.6.2

* 🩹 fix(Root): defer auth cookie check to useEffect after actor initialization

- Move the inline  →  redirect out of the render path
- Perform the login‐redirect in a  that runs once after
- Prevents spurious redirects on re‐renders (e.g. when using React DevTools “pause”)

* 🐛 Feature/prevent question details without data (#90)

 🐛 Add ternary operator to conditionally disable question details button

* Feature/docker debian slim wkhtmltopdf install (#91)

* chore(docker): switch to node:20-slim and install wkhtmltopdf
- solves crash during export

* Feature/feature/root add spinner on init (#92)

* feat(Root): show spinner while initializing and refactor auth redirect

* :chore: issues with auto-deploy on the test server

* ✨ chore: issues with auto-deploy to testserver

* Update deploy-test.yml

* ✨ chore: issues with auto-deploy to testserver

* version bump
bitbacchus added a commit that referenced this pull request Jun 23, 2025
* Hotfix Can only click on stats details when available (#85)

* update dependencies

* adds loading spinner to dashboard

* Hotfix: Stats details can only be clicked when stats avail.

* Revert "Hotfix Can only click on stats detaiils when availible (#85)" (#86)

This reverts commit 80a01a1.

* Create deploy-test.yml

* Update deploy-test.yml

* Update deploy-test.yml

* Update deploy-test.yml

* Delete .github/workflows/deploy-check.yml

* Update deployment.sh

Updated for Docker deployment

* Update deployment.sh

Logrotate function explicitly returns 0 now.

* 🔒 Improve token handling in TokenActor: retry on failure and clear previous timeout (#87)

* Update deploy-test.yml

* Update deploy-test.yml

* Update deployment.sh

* Version 1.6.2

* version 1.6.2

* 🐛 fix(Root): defer auth cookie check to useEffect after actor initialization (#89)

* PR version 1.6.2 (#88)

* Hotfix Can only click on stats detaiils when availible (#85)

* update dependencies

* adds loading spinner to dashboard

* Hotfix: Stats details can only be clicked when stats avail.

* Revert "Hotfix Can only click on stats detaiils when availible (#85)" (#86)

This reverts commit 80a01a1.

* Delete .github/workflows/deploy-check.yml

Updated for Docker deployment

Logrotate function explicitly returns 0 now.

* 🔒 Improve token handling in TokenActor: retry on failure and clear previous timeout (#87)

* Update deploy-test.yml

* Version 1.6.2

* 🩹 fix(Root): defer auth cookie check to useEffect after actor initialization

- Move the inline  →  redirect out of the render path
- Perform the login‐redirect in a  that runs once after
- Prevents spurious redirects on re‐renders (e.g. when using React DevTools “pause”)

* 🐛 Feature/prevent question details without data (#90)

 🐛 Add ternary operator to conditionally disable question details button

* Feature/docker debian slim wkhtmltopdf install (#91)

* chore(docker): switch to node:20-slim and install wkhtmltopdf
- solves crash during export

* Feature/feature/root add spinner on init (#92)

* feat(Root): show spinner while initializing and refactor auth redirect

* :chore: issues with auto-deploy on the test server

* ✨ chore: issues with auto-deploy to testserver

* Update deploy-test.yml

* ✨ chore: issues with auto-deploy to testserver

* version bump

* 🐛 fix(authRefresh): break infinite refresh loop by returning exipry timestamp (#94)

* 🐛 fix(authRefresh): break infinite refresh loop by returning expiry timestamp

* version bump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant