Fix registration API to use new group-based user creation method
Build And Push Image / docker (push) Successful in 1m56s
Details
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:
parent
cbf97254a2
commit
abd71445ab
Binary file not shown.
|
|
@ -92,8 +92,8 @@ export default defineEventHandler(async (event) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. Create Keycloak user with role-based registration
|
// 5. Create Keycloak user with group-based assignment
|
||||||
console.log('[api/registration.post] Creating Keycloak user with role-based system...');
|
console.log('[api/registration.post] Creating Keycloak user with group-based system...');
|
||||||
const paymentDueDate = new Date();
|
const paymentDueDate = new Date();
|
||||||
paymentDueDate.setMonth(paymentDueDate.getMonth() + 1); // 1 month from registration
|
paymentDueDate.setMonth(paymentDueDate.getMonth() + 1); // 1 month from registration
|
||||||
|
|
||||||
|
|
@ -108,11 +108,11 @@ export default defineEventHandler(async (event) => {
|
||||||
membershipTier: 'user' as const
|
membershipTier: 'user' as const
|
||||||
};
|
};
|
||||||
|
|
||||||
createdKeycloakId = await keycloakAdmin.createUserWithRoleRegistration({
|
createdKeycloakId = await keycloakAdmin.createUserWithGroupAssignment({
|
||||||
email: body.email,
|
email: body.email,
|
||||||
firstName: body.first_name,
|
firstName: body.first_name,
|
||||||
lastName: body.last_name,
|
lastName: body.last_name,
|
||||||
membershipTier: 'user', // All public registrations default to 'user' role
|
membershipTier: 'user', // All public registrations default to 'user' group
|
||||||
membershipData
|
membershipData
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue