Skip to content

Conversation

@RayWangQvQ
Copy link
Owner

@RayWangQvQ RayWangQvQ commented Jun 15, 2025

内容

#935

Enable web login

image

@RayWangQvQ RayWangQvQ requested a review from Copilot June 15, 2025 13:54

This comment was marked as outdated.

@RayWangQvQ RayWangQvQ requested a review from Copilot June 15, 2025 14:47

This comment was marked as outdated.

@RayWangQvQ RayWangQvQ requested a review from Copilot June 15, 2025 15:22

This comment was marked as outdated.

@RayWangQvQ RayWangQvQ requested a review from Copilot June 15, 2025 15:40
Copy link
Contributor

Copilot AI left a 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 {
Copy link

Copilot AI Jun 15, 2025

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.

Copilot uses AI. Check for mistakes.
@RayWangQvQ RayWangQvQ merged commit 8e966b2 into develop Jun 15, 2025
2 checks passed
@RayWangQvQ RayWangQvQ deleted the feature/935-web-login branch June 15, 2025 15:55
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.

1 participant