From e60143fed98c2afefeb94f0ae07c43b60441a27d Mon Sep 17 00:00:00 2001 From: alphaeusmote <41258468-alphaeusmote@users.noreply.replit.com> Date: Thu, 10 Apr 2025 03:06:51 +0000 Subject: [PATCH] Add LDAP and OIDC login options to authentication Replit-Commit-Author: Agent Replit-Commit-Session-Id: 705f2157-ef97-4fbd-89e4-8c7f2ecaea90 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7ed01c5f-a82d-405a-b728-b2e3d127c60c/b6eb1f50-1a4d-495b-a9d8-83d8b8b4f923.jpg --- client/src/pages/auth-page.tsx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/client/src/pages/auth-page.tsx b/client/src/pages/auth-page.tsx index 64fc41a..5b1cc14 100644 --- a/client/src/pages/auth-page.tsx +++ b/client/src/pages/auth-page.tsx @@ -98,13 +98,36 @@ export default function AuthPage() { } ); }; + + // Handle LDAP login form submission + const onLdapLoginSubmit = (data: LoginFormValues) => { + const { username, password } = data; + auth.ldapLoginMutation.mutate( + { username, password }, + { + onSuccess: () => { + navigate("/"); + } + } + ); + }; + + // Handle OIDC login + const handleOidcLogin = () => { + auth.initiateOidcLogin(); + }; // Handle register form submission const onRegisterSubmit = (data: RegisterFormValues) => { // Remove confirmPassword and acceptTerms which aren't part of the API request const { confirmPassword, acceptTerms, ...registerData } = data; + + // Add authProvider as 'local' for new registrations auth.registerMutation.mutate( - registerData, + { + ...registerData, + authProvider: 'local' // Explicitly set this for new users + }, { onSuccess: () => { navigate("/");