-
-
Couldn't load subscription status.
- Fork 4.7k
readme #8274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
readme #8274
Conversation
Reviewer's GuideThis PR replaces the existing README documentation with a TypeScript authentication provider module, implementing core Refine auth methods and addressing an infinite-loop bug on session expiry. Sequence diagram for session expiry and authentication loop fixsequenceDiagram
participant Browser
participant "authProvider.onError()"
participant "authProvider.logout()"
participant "Refine Core"
Browser->>"Refine Core": Request restricted page
"Refine Core"->>"authProvider.checkAuth()": Check authentication
"authProvider.checkAuth()"-->>"Refine Core": authenticated: false, redirectTo: /login
"Refine Core"->>Browser: Redirect to /login
Note over "authProvider.onError()","authProvider.logout()": On 401/403 error
"Refine Core"->>"authProvider.onError()": Handle error
"authProvider.onError()"-->>"Refine Core": { logout: true }
"Refine Core"->>"authProvider.logout()": Logout
"authProvider.logout()"-->>"Refine Core": success, redirectTo: /login
"Refine Core"->>Browser: Redirect to /login
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Action: Go to your running Refine application (http://localhost:3000) and navigate to any Edit page.
Test: Slowly resize your browser window to simulate a mobile screen (make it very narrow).
Expected Result: The "Save" and "Delete" buttons in the footer should wrap neatly to a new line when space runs out, and both buttons should remain aligned to the right of the card footer.
Action: You need to trigger a session expiry or manually simulate an unauthorized state.
Test (Simulated):
Log in successfully.
Open your browser's Developer Tools → Application → Local Storage and delete the stored authToken (or whatever key you use).
Attempt to navigate to a restricted page or refresh the current page.
You should be redirected immediately to the /login page.
Expected Result: You should not see a flash of the main application or get stuck in a loop of redirects. The application should handle the session expiry cleanly and immediately land on the login screen.
Summary by Sourcery
Provide a sample refine authProvider implementation in place of the old README, including secure token storage, identity retrieval, and handling of expired sessions to prevent infinite redirects.
New Features:
Bug Fixes:
Documentation: