-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[#935] Enable web login #936
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
Conversation
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.
Pull Request Overview
This PR enables web login functionality by adding authentication support and a new login page while updating the routing and layout components to accommodate secured routes. Key changes include:
- Introducing authentication components (CascadingAuthenticationState, AuthorizeRouteView) and an Authorize attribute in pages.
- Adding login UI components and associated back-end support (CustomAuthStateProvider, DbInitializer, migration to add User table).
- Updating the project files and documentation to reflect the new login feature.
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Ray.BiliBiliTool.Web/Components/Routes.razor | Wraps the router with authentication state and enforces authorization on routes. |
| src/Ray.BiliBiliTool.Web/Components/Pages/Schedules/Schedules.razor(.cs) | Applies authorization to schedules page; removes unused client reference. |
| src/Ray.BiliBiliTool.Web/Components/Pages/Login.razor(.cs/.razor/.razor.js) | Implements the login page UI and backing logic for web login. |
| src/Ray.BiliBiliTool.Web/Components/Layout/MainLayout.razor | Updates layout to include a logout link for authenticated users. |
| src/Ray.BiliBiliTool.Web/Auth/CustomAuthStateProvider.cs | Provides custom authentication state based on HTTP context. |
| src/Ray.BiliBiliTool.Infrastructure/Helpers/PasswordHelper.cs | Adds helper methods to hash and validate passwords. |
| src/Ray.BiliBiliTool.Infrastructure.EF/* | Contains migrations, DbInitializer, context modifications, and documentation updates for User support. |
| src/Ray.BiliBiliTool.Domain/User.cs | Introduces the User entity model to support login functionality. |
| common.props and CHANGELOG.md | Update version and changelog to reflect the new login feature. |
| @@ -0,0 +1,5 @@ | |||
| export class Login { | |||
Copilot
AI
Jun 15, 2025
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.
[nitpick] The empty Login class currently has no functionality; consider removing it if it's not planned for further use or add a comment explaining its intended future purpose.
内容
#935
Enable web login