Skip to content
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

Refactor OAuth2 login for Halo 2.20 #64

Merged
merged 6 commits into from
Oct 11, 2024

Conversation

JohnNiang
Copy link
Contributor

@JohnNiang JohnNiang commented Sep 26, 2024

This PR refactors OAuth2 login for adapting Halo 2.20. See halo-dev/halo#6702 for more.

How to build?

  1. Checkout to Support binding OAuth2 user automatically halo-dev/halo#6702
  2. Execute command ./gradlew publishToMavenLocal -Pversion=2.20.0+local.5 in Halo project
  3. Execute command ./gradlew build in current project.
None

@f2c-ci-robot f2c-ci-robot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. labels Sep 26, 2024
build.gradle Outdated Show resolved Hide resolved
build.gradle Outdated Show resolved Hide resolved
Signed-off-by: JohnNiang <[email protected]>
Signed-off-by: JohnNiang <[email protected]>
f2c-ci-robot bot pushed a commit to halo-dev/halo that referenced this pull request Sep 29, 2024
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.20.x

#### What this PR does / why we need it:

This PR add support for binding OAuth2 user automatically. So we can remove the user-binding page.

Please note that those changes may break the OAuth2 and SocialLogin plugins.

#### Special notes for your reviewer:

Build OAuth2 plugin from <halo-sigs/plugin-oauth2#64> or use [plugin-oauth2-1.0.4-SNAPSHOT.zip](https://github.com/user-attachments/files/17177592/plugin-oauth2-1.0.4-SNAPSHOT.zip) I built.

- Bind after logging in

1. Log in Halo with username and password method
2. Try to unbind OAuth2 user
3. Bind OAuth2 user again

- Initially bind without logging in

1. Go to login page
2. Log in with OAuth2 method and you will be redirected to login page
3. Log in with username and password method
4. See the result of binding

- Log in with OAuth2 method after binding

1. Go  to login page
2. Log in with OAuth2 method and you will be redirected to uc page directly

#### Does this PR introduce a user-facing change?

```release-note
支持自动绑定 OAuth2 登录用户
```
Signed-off-by: JohnNiang <[email protected]>
@JohnNiang JohnNiang changed the title WIP: Refactor OAuth2 login for Halo 2.20 Refactor OAuth2 login for Halo 2.20 Oct 10, 2024
@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 10, 2024
@JohnNiang
Copy link
Contributor Author

/ping @halo-sigs/halo

Copy link
Member

@guqing guqing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Oct 11, 2024
Copy link

f2c-ci-robot bot commented Oct 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 11, 2024
@f2c-ci-robot f2c-ci-robot bot merged commit ef9e4c4 into halo-sigs:main Oct 11, 2024
2 checks passed
@JohnNiang JohnNiang deleted the refactor/oauth2 branch October 11, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants