spine-framework 0.3.58 → 0.3.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -214,6 +214,7 @@ export const validateToken = createHandler(async (_ctx, _body) => {
|
|
|
214
214
|
*/
|
|
215
215
|
export const completeRegistration = createHandler(async (ctx, body) => {
|
|
216
216
|
const { path, account_name, email, role_slug } = body
|
|
217
|
+
console.log('completeRegistration called with:', { path, account_name, email, role_slug })
|
|
217
218
|
|
|
218
219
|
if (!path || !email) {
|
|
219
220
|
throw new Error('path and email are required')
|
|
@@ -240,23 +241,28 @@ export const completeRegistration = createHandler(async (ctx, body) => {
|
|
|
240
241
|
|
|
241
242
|
// Resolve role from role_slug param, or fall back to member_admin/member lookup
|
|
242
243
|
const targetRoleSlug = role_slug || 'member'
|
|
244
|
+
console.log('Looking for role:', targetRoleSlug)
|
|
245
|
+
|
|
243
246
|
let { data: roles } = await adminDb
|
|
244
247
|
.from('roles')
|
|
245
|
-
.select('id')
|
|
248
|
+
.select('id, slug')
|
|
246
249
|
.eq('slug', targetRoleSlug)
|
|
247
250
|
.limit(1)
|
|
248
251
|
|
|
249
252
|
let role = roles?.[0]
|
|
253
|
+
console.log('Found role:', role)
|
|
250
254
|
|
|
251
255
|
// If specific role not found, try member_admin or member as fallback
|
|
252
256
|
if (!role) {
|
|
257
|
+
console.log('Role not found, trying fallbacks...')
|
|
253
258
|
const { data: fallbackRoles } = await adminDb
|
|
254
259
|
.from('roles')
|
|
255
|
-
.select('id')
|
|
260
|
+
.select('id, slug')
|
|
256
261
|
.in('slug', ['member_admin', 'member'])
|
|
257
262
|
.order('slug')
|
|
258
263
|
.limit(1)
|
|
259
264
|
role = fallbackRoles?.[0]
|
|
265
|
+
console.log('Fallback role:', role)
|
|
260
266
|
}
|
|
261
267
|
|
|
262
268
|
// If no roles exist yet (apps not installed), create a default member role
|