Skip to content

Commit

Permalink
feat(server): add random username for phone signup (#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
HUAHUAI23 authored Jul 13, 2023
1 parent 28a3c78 commit 0c04bd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/authentication/phone/phone.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export class PhoneService {

try {
session.startTransaction()

const randomUsername = new ObjectId()
// create user
const user = await this.db.collection<User>('User').insertOne(
{
phone,
username: username || phone,
username: username || randomUsername.toString(),
createdAt: new Date(),
updatedAt: new Date(),
},
Expand Down

0 comments on commit 0c04bd8

Please sign in to comment.