+
Skip to content

Refactor createLoginUrl() to use standardized URL APIs #71

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

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

jonkoops
Copy link
Contributor

Closes #70

Closes keycloak#70

Signed-off-by: Jon Koops <jonkoops@gmail.com>
@jonkoops jonkoops requested a review from Copilot April 24, 2025 17:06
Copy link

@Copilot 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 refactors the createLoginUrl() function to use standardized URL APIs and updates related tests and support files accordingly.

  • Updated type imports in tests from keycloak.js to keycloak.d.ts
  • Added comprehensive tests for various login URL options in login-url.spec.ts and removed redundant claims tests
  • Refactored createLoginUrl() in lib/keycloak.js to use URLSearchParams and modern syntax, and updated the TestBed and TestExecutor interfaces/files

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/tests/silent-sso.spec.ts Updated type import to use keycloak.d.ts
test/tests/scope.spec.ts Updated type import to use keycloak.d.ts
test/tests/login.spec.ts Updated type import to use keycloak.d.ts
test/tests/login-url.spec.ts Added new tests to verify comprehensive login URL behaviors
test/tests/implicit-flow.spec.ts Updated type import to use keycloak.d.ts
test/tests/claims.spec.ts Removed redundant claims tests
test/support/testbed.ts Added realm property to TestBed interface and return value
test/support/test-executor.ts Updated createLoginUrl signature to accept an optional parameter
lib/keycloak.js Refactored createLoginUrl() to use URLSearchParams and modern syntax
Comments suppressed due to low confidence (2)

test/support/testbed.ts:92

  • [nitpick] Now that 'realm' is added to the TestBed interface and returned in createTestBed, consider adding a brief inline comment explaining this new property for maintainability.
+    realm,

lib/keycloak.js:497

  • Review the removal of the second parameter from adapter.redirectUri(options); ensure this change does not alter the intended behavior for logout redirects, particularly if a false flag was used to disable any encoding or special handling previously.
+            + '&post_logout_redirect_uri=' + encodeURIComponent(adapter.redirectUri(options));

@jonkoops jonkoops requested a review from a team April 24, 2025 17:27
Copy link

@douglaspalmer douglaspalmer left a comment

Choose a reason for hiding this comment

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

Looks a lot cleaner

@jonkoops jonkoops merged commit 4a4f7f6 into keycloak:main Apr 25, 2025
4 checks passed
@jonkoops jonkoops deleted the standard-api-login-url branch April 25, 2025 10:03
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.

Refactor createLoginUrl() to use standardized URL APIs
2 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载