AI Prompts for Diagnosing Auth Flow Breakage

20 of the best prompts for diagnosing auth flow breakage, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.

AI Prompts for Diagnosing Auth Flow Breakage

20 of the best prompts for diagnosing auth flow breakage, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.

Scroll to explore

Published July 2, 2026

The recent feature update has disrupted the login and session management processes, causing authentication failures. If unresolved, users will be unable to access their accounts, leading to a poor user experience and potential data loss. By following this guide, developers can systematically identify and resolve the issues affecting authentication flows. Built across 4 distinct stages covering Diagnose the Wall, Isolate and Fix, Verify the Resolution and more, this guide gives you one expert prompt per step so you never have to write from scratch or guess what the AI needs. The prompts work in ChatGPT, Claude, and Gemini and are designed to get usable output on the first try.

Diagnose the Wall

Look for error messages related to authentication failures in the console or logs after the recent update. The specific error message will guide the investigation.

Quote the authentication error

Please provide the exact error message you received after the last update regarding the authentication flow. Ensure to highlight the section that mentions the failed login attempt and any relevant details that could help diagnose the issue. Format your response by including the error message in quotes and any additional context that may be useful for troubleshooting.

Diagnose the Wall

Paste the auth callback function

Please analyze the authentication callback function from [FILE] at line [LINE]. I need you to evaluate its structure and identify any changes that may impact the login process. Provide a detailed explanation of your findings, including potential issues and suggestions for improvement.

Diagnose the Wall

State your understanding of the login process

Please explain your understanding of the login process for the use-case "replit-breaking-authentication." Include details about each step involved, potential points of failure, and any assumptions you are making based on the last instructions provided. This explanation will help us identify any miscommunication and clarify the necessary fixes.

Diagnose the Wall

Expected vs. actual behavior of login

Identify the expected behavior of the login function compared to the actual behavior in the context of [APPLICATION NAME]. Describe in detail what should happen upon a successful login, including any redirects or messages, and contrast this with the current behavior observed, highlighting any errors or discrepancies. Provide a structured comparison in a table format, listing the expected outcomes in one column and the actual outcomes in another.

Diagnose the Wall

Identify violated authentication rules

Please analyze the recent update for the use-case 'replit-breaking-authentication' and identify the specific authentication rule or constraint that was violated. Quote the exact clause governing session management, and provide a brief explanation of how this violation impacts the overall security posture. Format your response with the quoted rule clearly highlighted and a summary of the implications in bullet points.

Diagnose the Wall

Isolate and Fix

Target the specific function or configuration that is causing the authentication failure. Focus on the code that handles login and session management.

Fix the login function signature

Please analyze the login function signature in the file [FILE] at line [LINE]. The original signature is [PASTE], and the modified signature is [PASTE]. I need you to revert the signature back to the original version. Before making any changes, provide me with a diff of the changes that would be applied.

Isolate and Fix

Rewrite the session management logic

Rewrite the session management logic in the file located at [FILE] on line [LINE]. Ensure that the logic adheres to the original constraints by implementing checks for session expiration and verifying the user's authentication status. Provide a detailed explanation of the changes made and how they improve security and functionality in the session management process.

Isolate and Fix

Scoped change to auth middleware

Please modify the authentication middleware located in [FILE] at [LINE]. Ensure that the token validation logic is properly updated to enhance security while keeping the rest of the middleware unchanged. After making the changes, provide a brief explanation of the modifications made and how they improve the validation process.

Isolate and Fix

Enforce format for session tokens

Please review the session tokens in [FILE] at [LINE] to ensure they conform to the required format. Validate the generation and storage process of these tokens, and provide a detailed report that includes any discrepancies found, along with a formatted output for verification. Additionally, suggest any necessary changes to ensure compliance with the required format.

Isolate and Fix

Correct import statements for auth

Review the import statements related to authentication in [FILE]. Identify any incorrect or missing import statements and ensure that all necessary libraries are included. Provide a corrected version of the import section, along with a brief explanation of any changes made to ensure proper functionality.

Isolate and Fix

Verify the Resolution

Confirm that the authentication flow is functioning correctly after the fixes. Check for successful login and session management.

Run a test for successful login

Please run a test to verify the functionality of the login process after the recent changes. Ensure that a user can log in successfully and receives a valid session token upon authentication. Provide a detailed report of the test results, including any errors encountered, the time taken for the login process, and whether the session token meets the expected format.

Verify the Resolution

Show diff of the auth function

Please provide the differences in the authentication function located in [FILE] after the recent changes have been applied. I need a clear comparison that highlights the specific modifications made, including added, removed, and modified lines. Format the output to clearly indicate the changes with appropriate annotations for each modification.

Verify the Resolution

Replay the original failing login scenario

Replay the original scenario that resulted in the authentication failure for the use-case of [REPLIT-BREAKING-AUTHENTICATION]. Please provide a detailed account of the steps taken during the login attempt, including any error messages encountered. After replaying the scenario, confirm whether the issue persists or if it has been resolved, and summarize your findings in a structured format.

Verify the Resolution

Check edge case for session expiration

Please test the edge case where the session token has expired in the authentication system. Confirm that the system correctly identifies the expired session and prompts the user for re-authentication. Provide a detailed report on the behavior observed during the test, including any error messages displayed and the steps taken to reproduce the issue.

Verify the Resolution

Confirm state of auth-related files

Please verify the state of the authentication-related files: [FILE] and [FILE]. Check that all relevant functions and variables are correctly defined and accessible after the recent fixes. Provide a summary of any discrepancies found and suggest necessary corrections to ensure proper functionality.

Verify the Resolution

Prevent Recurrence

Create artefacts that will help prevent future issues with authentication flows in Replit. Focus on constraints and checks.

Auth flow constraint prompt

Please provide the exact constraint for the authentication flow in the project titled [PROJECT NAME]. Use the following format: 'Before any deployment step: verify that the login function returns a valid session token. If the token is invalid, stop and log an error before continuing. Never deploy without confirming valid authentication.' Ensure the output is clear and ready for immediate use.

Prevent Recurrence

Session management check template

Please create a session management check template that can be used before deployment. The template should include the following instructions: 'Before deployment, confirm that all session tokens are valid and have not expired. If any tokens are invalid, halt the process and notify the developer.' Format the output as a clear checklist that can be easily followed by developers.

Prevent Recurrence

Code comment guard for auth

Please add a code comment guard in [FILE] that includes the following text: 'Ensure that any changes to authentication functions are reviewed for compliance with session management rules. Any deviation from expected behavior must be logged.' Make sure to format the comment according to the coding standards used in the project, and provide the complete code snippet with the comment included.

Prevent Recurrence

Project convention message for auth

Draft a project convention message that emphasizes the importance of maintaining authentication flow integrity. The message should state: "All developers must ensure that any changes to authentication logic are tested against the expected behavior. Document any deviations clearly." Please provide the final text in a format that can be easily copied and pasted for team communication.

Prevent Recurrence

Self-check request for auth flows

Please create a self-check request for authentication flows that an agent should run before deployment. The request should include the following instructions: 'Before deploying, check that all authentication flows are functioning correctly. If any flow fails, stop the deployment and report the issue.' Ensure the output is formatted clearly and can be easily understood by the team responsible for deployment.

Prevent Recurrence

Frequently asked questions

What causes authentication failures in Replit?+

Authentication failures in Replit can occur due to changes in the login function or session management logic. If the function signature or token validation logic is altered, it can lead to users being unable to log in.

How can I debug session management issues?+

To debug session management issues, check the console for error messages related to token validation or session expiration. Replit's environment may not properly handle expired tokens, leading to unexpected behavior.

What should I do if my auth flow is broken after an update?+

If your auth flow is broken after an update, first check the error messages in the console. Replit may have introduced changes that affect how sessions are managed, requiring you to adjust your code.

How does Replit handle authentication tokens?+

Replit manages authentication tokens within its environment, but improper handling can lead to issues. Ensure that tokens are generated and validated correctly to avoid login failures.

What are common pitfalls in auth flow updates?+

Common pitfalls in auth flow updates include failing to validate session tokens or incorrectly modifying the login function. Replit's deployment process may not catch these issues, leading to broken authentication.