Fix registration API to use new group-based user creation method
All checks were successful
Build And Push Image / docker (push) Successful in 1m56s
All checks were successful
Build And Push Image / docker (push) Successful in 1m56s
- 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:
Binary file not shown.
@@ -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
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user