mirror of
https://github.com/freedbygrace/ActiveDirectoryManager.git
synced 2026-07-27 12:29:42 +00:00
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
This commit is contained in:
@@ -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("/");
|
||||
|
||||
Reference in New Issue
Block a user