Skip to content

Remove unused variables and clean up code formatting in PR #438 - #439

Closed
mikemtdev with Copilot wants to merge 1 commit into
mainfrom
copilot/remove-unused-vars-and-optimization
Closed

mikemtdev with Copilot wants to merge 1 commit into
mainfrom
copilot/remove-unused-vars-and-optimization

Conversation

Copilot AI commented Oct 7, 2025 •

Copy link
Copy Markdown

This PR removes unused variables and cleans up code formatting issues introduced in PR #438 (feat/routes_to_permission).

Changes

Removed Unused Variables

src/middleware.ts

  • Removed unused token variable that was declared but never referenced. The session variable already contains all necessary authentication information.

src/hooks/useAuth/index.ts

  • Removed unused singInResp variable in handleLogin function. The signIn() call is now awaited directly without storing the result, since setUser() is called unconditionally.
  • Removed unused userclearFromStoreResp variable in handleLogout function. The clearUser() call is now invoked directly, and the success message is always shown.

src/hocs/withAuthorization.tsx

  • Removed unused isAuthRoute helper function that was defined but never called anywhere in the codebase.

Code Cleanup

src/app/auth/login/page.tsx

  • Removed extraneous semicolon at the end of the file.

src/app/admin/layout.tsx

  • Removed extra blank lines for consistency.
  • Fixed function declaration to use arrow function syntax, matching the pattern used elsewhere in the codebase.

Impact

  • 5 files changed: 13 insertions(+), 28 deletions(-)
  • Net reduction: 15 lines of code removed
  • Linter: ✅ Passes with 0 warnings and 0 errors
  • Functionality: No behavioral changes, only code cleanup

These changes improve code quality and maintainability by removing dead code and enforcing consistent formatting.

Original prompt

remove unused vars and @SparkEdUAB/sparked-next/pull/438


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@dokploy-2025-09-04-9e6xob

Copy link
Copy Markdown

🚨 Preview Deployment Blocked - Security Protection

Your pull request was blocked from triggering preview deployments

Why was this blocked?

  • User: Copilot
  • Repository: sparked-next
  • Permission Level: none
  • Required Level: write, maintain, or admin

How to resolve this:

Option 1: Get Collaborator Access (Recommended)
Ask a repository maintainer to invite you as a collaborator with write permissions or higher.

Option 2: Request Permission Override
Ask a repository administrator to disable security validation for this specific application if appropriate.

For Repository Administrators:

To disable this security check (⚠️ not recommended for public repositories):
Enter to preview settings and disable the security check.


This security measure protects against malicious code execution in preview deployments. Only trusted collaborators should have the ability to trigger deployments.

🛡️ Learn more about this security feature

This protection prevents unauthorized users from:

  • Executing malicious code on the deployment server
  • Accessing environment variables and secrets
  • Potentially compromising the infrastructure

Preview deployments are powerful but require trust. Only users with repository write access can trigger them.

@OlivierJM
OlivierJM temporarily deployed to copilot/remove-unused-vars-and-optimization - sparked-app PR #439 October 7, 2025 14:42 — with Render Destroyed
Copilot AI changed the title [WIP] Remove unused variables from codebase for clarity Remove unused variables and clean up code formatting in PR #438 Oct 7, 2025
Copilot AI requested a review from mikemtdev October 7, 2025 14:57
@mikemtdev mikemtdev closed this Oct 9, 2025

This branch was successfully deployed

No deployments
copilot/remove-unused-vars-and-optimization - sparked-app PR #439 — 7fbb6ff3 Deployed Oct 7, 2025 by OlivierJM
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.

3 participants