Refactor auth endpoints and add React frontend#9
Draft
Conversation
- Update login endpoint to return JSON responses - Update auth endpoint to return JSON responses - Add proper error handling with RFC-compliant error responses - Remove template-based responses - Add CORS support for frontend integration
- Update login endpoint to return JSON responses - Update auth endpoint to return JSON responses - Add proper error handling with RFC-compliant error responses - Remove template-based responses - Add CORS support for frontend integration
|
| } | ||
|
|
||
| export interface LoginResponse { | ||
| success: boolean; |
| nonce: params.get('nonce') || undefined, | ||
| }); | ||
| setAuthData(data); | ||
| } catch (error: any) { |
| @@ -0,0 +1 @@ | |||
| /// <reference types="vite/client" /> | |||
| success: true, | ||
| redirect_url: response.data.redirect_url, | ||
| }; | ||
| } catch (error: any) { |
| nonce: params.get('nonce') || undefined, | ||
| }); | ||
| window.location.href = redirectUrl; | ||
| } catch (error: any) { |
- Add Node.js container for frontend development - Configure Vite for Docker environment - Add CORS and host settings - Link frontend with backend API
- Update auth endpoint to handle both JSON and redirect responses - Add content negotiation based on Accept header - Fix frontend routing with proper basename - Update CORS settings for better integration
- Add LoginRequest schema for request body validation - Update login endpoint to use Pydantic model - Fix CSRF token validation - Add proper error handling for validation errors
- Add content negotiation based on Accept header - Update login endpoint to handle both browser and API requests - Add Accept header to frontend API client - Fix CSRF token handling
- Forward query parameters from React to API - Update login function to include query string - Update CSRF token fetch to include query string - Fix dependency array in useEffect
Closed
- Add nginx configuration for single domain - Update docker-compose to include nginx service - Update frontend API URL to use relative path - Update CORS settings for nginx domain - Fix redirect URLs to be relative
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
This PR introduces two major changes:
Refactor authentication and authorization endpoints to be RFC-compliant and JSON-based
Add React-based frontend implementation
Technical Details
Backend Changes
Frontend Implementation
Testing
The changes have been tested manually with the following scenarios:
Security Considerations
Next Steps
Breaking Changes
Related Issues