- 
                Notifications
    
You must be signed in to change notification settings  - Fork 402
 
add signOutCallback to UserButton #7006
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| 
          
            
          
           | 
    @@ -120,10 +120,10 @@ | |||||
| 
     | 
||||||
| export type ListenerCallback = (emission: Resources) => void; | ||||||
| export type UnsubscribeCallback = () => void; | ||||||
| export type BeforeEmitCallback = (session?: SignedInSessionResource | null) => void | Promise<any>; | ||||||
| export type SetActiveNavigate = ({ session }: { session: SessionResource }) => void | Promise<unknown>; | ||||||
| export type BeforeEmitCallback = (session?: SignedInSessionResource | null) => undefined | Promise<any>; | ||||||
| export type SetActiveNavigate = ({ session }: { session: SessionResource }) => undefined | Promise<unknown>; | ||||||
| 
     | 
||||||
| export type SignOutCallback = () => void | Promise<any>; | ||||||
| export type SignOutCallback = () => undefined | Promise<any>; | ||||||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use  The return type uses  Apply this diff: -export type SignOutCallback = () => undefined | Promise<any>;
+export type SignOutCallback = () => undefined | Promise<unknown>;📝 Committable suggestion
 
        Suggested change
       
    
 🤖 Prompt for AI Agents | 
||||||
| 
     | 
||||||
| export type SignOutOptions = { | ||||||
| /** | ||||||
| 
          
            
          
           | 
    @@ -944,7 +944,7 @@ | |||||
| 
     | 
||||||
| export type HandleSamlCallbackParams = HandleOAuthCallbackParams; | ||||||
| 
     | 
||||||
| export type CustomNavigation = (to: string, options?: NavigateOptions) => Promise<unknown> | void; | ||||||
| export type CustomNavigation = (to: string, options?: NavigateOptions) => Promise<unknown> | undefined; | ||||||
| 
     | 
||||||
| export type ClerkThemeOptions = DeepSnakeToCamel<DeepPartial<DisplayThemeJSON>>; | ||||||
| 
     | 
||||||
| 
          
            
          
           | 
    @@ -1175,7 +1175,7 @@ | |||||
| */ | ||||||
| windowNavigate: (to: URL | string) => void; | ||||||
| }, | ||||||
| ) => Promise<unknown> | unknown; | ||||||
| 
     | 
||||||
| export type WithoutRouting<T> = Omit<T, 'path' | 'routing'>; | ||||||
| 
     | 
||||||
| 
          
            
          
           | 
    @@ -1640,6 +1640,12 @@ | |||||
| * Provide custom menu actions and links to be rendered inside the UserButton. | ||||||
| */ | ||||||
| customMenuItems?: CustomMenuItem[]; | ||||||
| 
     | 
||||||
| /** | ||||||
| * Callback to be executed after the user signs out. Overrides the default navigation behavior. | ||||||
| * If provided, this callback will be used instead of navigating to `afterSignOutUrl`. | ||||||
| */ | ||||||
| signOutCallback?: SignOutCallback; | ||||||
| }; | ||||||
| 
     | 
||||||
| export type UserAvatarProps = { | ||||||
| 
          
            
          
           | 
    ||||||
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.
Use
Promise<unknown>instead ofPromise<any>for consistency.The return type uses
Promise<any>which is less type-safe thanPromise<unknown>. Line 124 (SetActiveNavigate) usesPromise<unknown>, so this should follow the same pattern for consistency.Apply this diff:
📝 Committable suggestion
🤖 Prompt for AI Agents