Skip to content

fix: pass args to useAutoSignin#1917

Merged
pamapa merged 1 commit intoauthts:mainfrom
williamsjokvist:main
Mar 3, 2026
Merged

fix: pass args to useAutoSignin#1917
pamapa merged 1 commit intoauthts:mainfrom
williamsjokvist:main

Conversation

@williamsjokvist
Copy link
Contributor

Closes #1916

Checklist

  • This PR makes changes to the public API
  • I have included links for closing relevant issue numbers

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.78%. Comparing base (c30b216) to head (39d2225).
⚠️ Report is 39 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1917   +/-   ##
=======================================
  Coverage   83.78%   83.78%           
=======================================
  Files          11       11           
  Lines         185      185           
  Branches       31       31           
=======================================
  Hits          155      155           
  Misses         16       16           
  Partials       14       14           
Flag Coverage Δ
unittests 83.78% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pamapa
Copy link
Member

pamapa commented Feb 26, 2026

i very much like the idea to support passing args....


export function useAutoSignin({ signinMethod = "signinRedirect", args }: {
signinMethod?: "signinRedirect" | "signinPopup";
args?: SigninPopupArgs | SigninRedirectArgs;
Copy link
Member

Choose a reason for hiding this comment

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

to be aligned with signinMethod, please rename args to signinArgs

@williamsjokvist
Copy link
Contributor Author

done, please have a look @pamapa

@pamapa pamapa added this to the 3.3.1 milestone Mar 3, 2026
@pamapa
Copy link
Member

pamapa commented Mar 3, 2026

looks good, once the unit-tests work again i will merge:

Error: test/useAutoSignin.test.tsx(61,45): error TS2769: No overload matches this call.
  Overload 1 of 3, '(options?: { signinArgs?: SigninRedirectArgs | undefined; } | undefined): UseAutoSignInReturn', gave the following error.
    Object literal may only specify known properties, and 'signinMethod' does not exist in type '{ signinArgs?: SigninRedirectArgs | undefined; }'.
  Overload 2 of 3, '(options: { signinMethod: "signinRedirect"; signinArgs?: SigninRedirectArgs | undefined; }): UseAutoSignInReturn', gave the following error.
    Object literal may only specify known properties, and 'args' does not exist in type '{ signinMethod: "signinRedirect"; signinArgs?: SigninRedirectArgs | undefined; }'.
  Overload 3 of 3, '(options: { signinMethod: "signinPopup"; signinArgs?: SigninPopupArgs | undefined; }): UseAutoSignInReturn', gave the following error.
    Type '"signinRedirect"' is not assignable to type '"signinPopup"'.
Error: test/useAutoSignin.test.tsx(81,45): error TS2769: No overload matches this call.
  Overload 1 of 3, '(options?: { signinArgs?: SigninRedirectArgs | undefined; } | undefined): UseAutoSignInReturn', gave the following error.
    Object literal may only specify known properties, and 'signinMethod' does not exist in type '{ signinArgs?: SigninRedirectArgs | undefined; }'.
  Overload 2 of 3, '(options: { signinMethod: "signinRedirect"; signinArgs?: SigninRedirectArgs | undefined; }): UseAutoSignInReturn', gave the following error.
    Type '"signinPopup"' is not assignable to type '"signinRedirect"'.
  Overload 3 of 3, '(options: { signinMethod: "signinPopup"; signinArgs?: SigninPopupArgs | undefined; }): UseAutoSignInReturn', gave the following error.
    Object literal may only specify known properties, and 'args' does not exist in type '{ signinMethod: "signinPopup"; signinArgs?: SigninPopupArgs | undefined; }'.
Error: test/useAutoSignin.test.tsx(98,13): error TS2769: No overload matches this call.
  Overload 1 of 3, '(options?: { signinArgs?: SigninRedirectArgs | undefined; } | undefined): UseAutoSignInReturn', gave the following error.
    Object literal may only specify known properties, and 'args' does not exist in type '{ signinArgs?: SigninRedirectArgs | undefined; }'.
  Overload 2 of 3, '(options: { signinMethod: "signinRedirect"; signinArgs?: SigninRedirectArgs | undefined; }): UseAutoSignInReturn', gave the following error.
    Object literal may only specify known properties, and 'args' does not exist in type '{ signinMethod: "signinRedirect"; signinArgs?: SigninRedirectArgs | undefined; }'.
  Overload 3 of 3, '(options: { signinMethod: "signinPopup"; signinArgs?: SigninPopupArgs | undefined; }): UseAutoSignInReturn', gave the following error.
    Object literal may only specify known properties, and 'args' does not exist in type '{ signinMethod: "signinPopup"; signinArgs?: SigninPopupArgs | undefined; }'.
Error: Process completed with exit code 2.

@williamsjokvist
Copy link
Contributor Author

Ahh forgot to update the tests, fixed @pamapa

@pamapa pamapa merged commit fd3c110 into authts:main Mar 3, 2026
2 checks passed
@pamapa
Copy link
Member

pamapa commented Mar 3, 2026

Thanks for contributing!

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.

useAutoSignin not propogating signinRedirect/popup properties

2 participants