[GH-ISSUE #1643] FEATURE REQUEST: disable Login Option and directly direct to OIDC #465

Closed
opened 2026-02-26 18:47:09 +03:00 by kerem · 5 comments
Owner

Originally created by @celevra on GitHub (Feb 8, 2025).
Original GitHub issue: https://github.com/documenso/documenso/issues/1643

Hi,

if OIDC is configured and working there should be an option to disable the internal Login and directly direct to the OIDC provider.

regards

Celevra

Originally created by @celevra on GitHub (Feb 8, 2025). Original GitHub issue: https://github.com/documenso/documenso/issues/1643 Hi, if OIDC is configured and working there should be an option to disable the internal Login and directly direct to the OIDC provider. regards Celevra
kerem 2026-02-26 18:47:09 +03:00
Author
Owner

@MohdSaquib114 commented on GitHub (Feb 8, 2025):

Hi, I'd like to work on this issue. Also, is there any additional information or specific requirements I should be aware of? Thanks!

<!-- gh-comment-id:2645886790 --> @MohdSaquib114 commented on GitHub (Feb 8, 2025): Hi, I'd like to work on this issue. Also, is there any additional information or specific requirements I should be aware of? Thanks!
Author
Owner

@celevra commented on GitHub (Feb 8, 2025):

@MohdSaquib114 thank you. Nothing i can think of, if oidc is the default login method no login form is needed and also no need for the oidc button, in an event of no valid user session oidc workflow can be started without a click

<!-- gh-comment-id:2645888737 --> @celevra commented on GitHub (Feb 8, 2025): @MohdSaquib114 thank you. Nothing i can think of, if oidc is the default login method no login form is needed and also no need for the oidc button, in an event of no valid user session oidc workflow can be started without a click
Author
Owner

@MohdSaquib114 commented on GitHub (Feb 9, 2025):

Hey @celevra! 👋

I came up with this solution for the feature request:

useEffect(() => {
  if (!isOIDCDefault || !isOIDCSSOEnabled) return;

  if (status === 'unauthenticated') {
    signIn('oidc', { callbackUrl }).catch(() =>
      toast({
        title: 'OIDC Login Failed',
        description: 'We encountered an error while attempting to sign you in.',
        variant: 'destructive',
      })
    );
  }
}, [isOIDCDefault, isOIDCSSOEnabled, callbackUrl, toast, status]);

Approach Used:

  1. Optimized Execution – Runs only when OIDC is the default and enabled.
  2. Session Validation – Automatically triggers OIDC login if the user is unauthenticated.
  3. Robust Error Handling – Displays a toast notification if the login attempt fails.

I'm new to open source, I'd love to know if this approach is correct or if there's anything I should improve. Any feedback would be really helpful! 😊🚀

<!-- gh-comment-id:2646109924 --> @MohdSaquib114 commented on GitHub (Feb 9, 2025): Hey @celevra! 👋 I came up with this solution for the feature request: ```tsx useEffect(() => { if (!isOIDCDefault || !isOIDCSSOEnabled) return; if (status === 'unauthenticated') { signIn('oidc', { callbackUrl }).catch(() => toast({ title: 'OIDC Login Failed', description: 'We encountered an error while attempting to sign you in.', variant: 'destructive', }) ); } }, [isOIDCDefault, isOIDCSSOEnabled, callbackUrl, toast, status]); ``` ### Approach Used: 1. **Optimized Execution** – Runs only when OIDC is the default and enabled. 2. **Session Validation** – Automatically triggers OIDC login if the user is unauthenticated. 3. **Robust Error Handling** – Displays a toast notification if the login attempt fails. I'm new to open source, I'd love to know if this approach is correct or if there's anything I should improve. Any feedback would be really helpful! 😊🚀
Author
Owner

@celevra commented on GitHub (Feb 9, 2025):

sounds good, think you have to create a pull request.
In which file do i have to put this code? than i can test it

<!-- gh-comment-id:2646329584 --> @celevra commented on GitHub (Feb 9, 2025): sounds good, think you have to create a pull request. In which file do i have to put this code? than i can test it
Author
Owner

@MohdSaquib114 commented on GitHub (Feb 9, 2025):

In web/src/components/form/signinl.tsx

<!-- gh-comment-id:2646441268 --> @MohdSaquib114 commented on GitHub (Feb 9, 2025): In web/src/components/form/signinl.tsx
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#465
No description provided.