Fix registration API to use new group-based user creation method
Build And Push Image / docker (push) Successful in 1m56s Details

- Replace deprecated createUserWithRoleRegistration with createUserWithGroupAssignment
- Update comments to reflect group-based system instead of role-based
- Resolves registration error when creating new users
This commit is contained in:
Matt 2025-08-31 19:13:09 +02:00
parent cbf97254a2
commit abd71445ab
2 changed files with 4 additions and 4 deletions

View File

@ -92,8 +92,8 @@ export default defineEventHandler(async (event) => {
});
}
// 5. Create Keycloak user with role-based registration
console.log('[api/registration.post] Creating Keycloak user with role-based system...');
// 5. Create Keycloak user with group-based assignment
console.log('[api/registration.post] Creating Keycloak user with group-based system...');
const paymentDueDate = new Date();
paymentDueDate.setMonth(paymentDueDate.getMonth() + 1); // 1 month from registration
@ -108,11 +108,11 @@ export default defineEventHandler(async (event) => {
membershipTier: 'user' as const
};
createdKeycloakId = await keycloakAdmin.createUserWithRoleRegistration({
createdKeycloakId = await keycloakAdmin.createUserWithGroupAssignment({
email: body.email,
firstName: body.first_name,
lastName: body.last_name,
membershipTier: 'user', // All public registrations default to 'user' role
membershipTier: 'user', // All public registrations default to 'user' group
membershipData
});