Skip to content

Commit

Permalink
πŸ› Remote user with no email (#274)
Browse files Browse the repository at this point in the history
Co-authored-by: Monta <[email protected]>
  • Loading branch information
MontaGhanmy and Monta authored Nov 23, 2023
1 parent 05d9639 commit d79c923
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tdrive/backend/node/src/services/console/clients/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,12 @@ export class ConsoleRemoteClient implements ConsoleServiceClient {

if (!user) {
if (!userDTO.email) {
throw CrudException.badRequest(`Email is required: ${JSON.stringify(userDTO)}`);
// if the id is an email, use it as email
if (userDTO._id.includes("@")) {
userDTO.email = userDTO._id;
} else {
throw CrudException.badRequest(`Email is required: ${JSON.stringify(userDTO)}`);
}
}

let username = userDTO.email
Expand Down

0 comments on commit d79c923

Please sign in to comment.