Compare commits

...

7 Commits

Author SHA1 Message Date
Flatlogic Bot
d36801edc4 v2 2025-09-01 15:39:23 +00:00
Flatlogic Bot
d2cac44198 v1 2025-09-01 07:10:38 +00:00
Flatlogic Bot
6f394c3332 v1 2025-09-01 07:10:38 +00:00
Flatlogic Bot
fdd205e533 v1 2025-09-01 07:10:32 +00:00
Flatlogic Bot
eb052a7457 v1 2025-09-01 07:08:42 +00:00
Flatlogic Bot
207b5a16d5 v1 2025-09-01 07:08:20 +00:00
Flatlogic Bot
995620e868 v1 2025-09-01 07:08:04 +00:00
4 changed files with 24 additions and 11 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
node_modules/ node_modules/
*/node_modules/ */node_modules/
*/build/ */build/
**/node_modules/
**/build/
.DS_Store
.env

File diff suppressed because one or more lines are too long

View File

@ -43,23 +43,30 @@ class Auth {
return helpers.jwtSign(data); return helpers.jwtSign(data);
} }
const newUser = await UsersDBApi.createFromAuth( // Create new user with default role
{ const newUser = await UsersDBApi.create(
firstName: email.split('@')[0], { data: {
password: hashedPassword, firstName: email.split('@')[0],
email: email, password: hashedPassword,
}, email: email,
options, }
}
); );
// Send verification email if configured
if (EmailSender.isConfigured) { if (EmailSender.isConfigured) {
await this.sendEmailAddressVerificationEmail(newUser.email, host); await this.sendEmailAddressVerificationEmail(newUser.email, host);
} }
// Fetch assigned role instance
const roleInstance = await newUser.getApp_role();
// Build JWT payload including role
const data = { const data = {
user: { user: {
id: newUser.id, id: newUser.id,
email: newUser.email, email: newUser.email,
role: roleInstance ? roleInstance.name : null,
}, },
}; };

View File

@ -0,0 +1 @@
{}