@fonoster/identity 0.15.4 → 0.15.6

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.
@@ -27,9 +27,6 @@
27
27
  border: none;
28
28
  cursor: pointer;
29
29
  }
30
- .fonoster-green {
31
- color: #053204;
32
- }
33
30
  @media (prefers-color-scheme: dark) {
34
31
  body {
35
32
  background-color: #181818;
@@ -38,15 +35,12 @@
38
35
  .container {
39
36
  background: #181818;
40
37
  }
41
- .fonoster-green {
42
- color: #f4f4f4;
43
- }
44
38
  }
45
39
  </style>
46
40
  </head>
47
41
  <body>
48
42
  <div class="container">
49
- <p>Invitation to join the workspace <b class="fonoster-green">{{workspaceName}}</b> on Fonoster extended.</p>
43
+ <p>You have been invited to join the workspace <b>{{workspaceName}}</b> on Fonoster.</p>
50
44
  <p>To accept the invitation, please use the button below:</p>
51
45
  <a href="{{inviteUrl}}" class="button">Join Workspace</a>
52
46
  </div>
@@ -27,9 +27,6 @@
27
27
  border: none;
28
28
  cursor: pointer;
29
29
  }
30
- .fonoster-green {
31
- color: #053204;
32
- }
33
30
  @media (prefers-color-scheme: dark) {
34
31
  body {
35
32
  background-color: #181818;
@@ -38,16 +35,13 @@
38
35
  .container {
39
36
  background: #181818;
40
37
  }
41
- .fonoster-green {
42
- color: #f4f4f4;
43
- }
44
38
  }
45
39
  </style>
46
40
  </head>
47
41
  <body>
48
42
  <div class="container">
49
- <p>You have been invited to join the workspace <b class="fonoster-green">{{workspaceName}}</b> on Fonoster.</p>
50
- <p>Assigned one-time password: <b class="fonoster-brown">{{oneTimePassword}}</b></p>
43
+ <p>You have been invited to join the workspace <b>{{workspaceName}}</b> on Fonoster.</p>
44
+ <p>Your assigned one-time password: <b>{{oneTimePassword}}</b></p>
51
45
  <p>For access, please click on the button below:</p>
52
46
  <a href="{{inviteUrl}}" class="button">Access Workspace</a>
53
47
  </div>
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Verification Code</title>
4
+ <title>Fonoster - Email Verification</title>
5
5
  <style>
6
6
  body {
7
7
  font-family: Arial, sans-serif;
@@ -31,9 +31,9 @@
31
31
  </head>
32
32
  <body>
33
33
  <div class="container">
34
- <p>To continue, please verify your account with the code below:</p>
34
+ <p>To continue with your Fonoster account, please verify your email with the code below:</p>
35
35
  <p class="verification-code">{{verificationCode}}</p>
36
- <p>If you didnt request this code, you can ignore this message.</p>
36
+ <p>If you didn't request this code, you can ignore this message.</p>
37
37
  </div>
38
38
  </body>
39
39
  </html>
@@ -1,3 +1,3 @@
1
- To continue, please verify your account with the following code: {{verificationCode}}
1
+ To continue with your Fonoster account, please verify your phone with the following code: {{verificationCode}}
2
2
 
3
- If you didn't request this, please ignore this message.
3
+ If you didn't request this code, please ignore this message.
@@ -35,7 +35,7 @@ const logger = (0, logger_1.getLogger)({ service: "identity", filePath: __filena
35
35
  function createCreateUser(prisma) {
36
36
  const createUser = (call, callback) => __awaiter(this, void 0, void 0, function* () {
37
37
  const { request } = call;
38
- const { name, email, password, avatar } = request;
38
+ const { name, email, password, avatar, phone } = request;
39
39
  logger.verbose("call to createUser", { email });
40
40
  const user = yield prisma.user.create({
41
41
  data: {
@@ -43,7 +43,8 @@ function createCreateUser(prisma) {
43
43
  email,
44
44
  accessKeyId: (0, generateAccessKeyId_1.generateAccessKeyId)(generateAccessKeyId_1.AccessKeyIdType.USER),
45
45
  password,
46
- avatar
46
+ avatar,
47
+ phoneNumber: phone || undefined
47
48
  }
48
49
  });
49
50
  const { ref } = user;
@@ -35,21 +35,26 @@ const logger = (0, logger_1.getLogger)({ service: "identity", filePath: __filena
35
35
  function createUpdateUser(prisma) {
36
36
  const updateUser = (call, callback) => __awaiter(this, void 0, void 0, function* () {
37
37
  const { request } = call;
38
- const { ref, name, avatar, password } = request;
38
+ const { ref, name, avatar, password, phone } = request;
39
39
  const token = (0, common_1.getTokenFromCall)(call);
40
40
  const accessKeyId = (0, utils_1.getAccessKeyIdFromToken)(token);
41
41
  logger.verbose("call to updateUser", { ref, password });
42
+ const updateData = {
43
+ name,
44
+ avatar,
45
+ password: password || undefined,
46
+ updatedAt: new Date()
47
+ };
48
+ if (phone && phone !== "") {
49
+ updateData.phoneNumber = phone;
50
+ updateData.phoneNumberVerified = false;
51
+ }
42
52
  yield prisma.user.update({
43
53
  where: {
44
54
  ref,
45
55
  accessKeyId
46
56
  },
47
- data: {
48
- name,
49
- avatar,
50
- password: password || undefined,
51
- updatedAt: new Date()
52
- }
57
+ data: updateData
53
58
  });
54
59
  const response = {
55
60
  ref
@@ -21,4 +21,11 @@ type SendResetPasswordEmailRequest = {
21
21
  templateDir?: string;
22
22
  resetPasswordUrl: string;
23
23
  };
24
- export { SendResetPasswordEmailRequest };
24
+ type UserUpdateInput = {
25
+ name?: string;
26
+ avatar?: string;
27
+ password?: string;
28
+ phoneNumber?: string;
29
+ phoneNumberVerified?: boolean;
30
+ };
31
+ export { SendResetPasswordEmailRequest, UserUpdateInput };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fonoster/identity",
3
- "version": "0.15.4",
3
+ "version": "0.15.6",
4
4
  "description": "Identity service for Fonoster",
5
5
  "author": "Pedro Sanders <psanders@fonoster.com>",
6
6
  "homepage": "https://github.com/fonoster/fonoster#readme",
@@ -20,9 +20,9 @@
20
20
  "fonoster": "./dist/index.js"
21
21
  },
22
22
  "dependencies": {
23
- "@fonoster/common": "^0.15.3",
23
+ "@fonoster/common": "^0.15.5",
24
24
  "@fonoster/logger": "^0.15.3",
25
- "@fonoster/types": "^0.15.3",
25
+ "@fonoster/types": "^0.15.5",
26
26
  "@grpc/grpc-js": "~1.10.6",
27
27
  "@prisma/client": "^6.8.2",
28
28
  "jsonwebtoken": "^9.0.2",
@@ -48,5 +48,5 @@
48
48
  "devDependencies": {
49
49
  "@types/jsonwebtoken": "^9.0.6"
50
50
  },
51
- "gitHead": "8309a754e9dd2567727981dc3255f8fa1f3cc554"
51
+ "gitHead": "a36d15e037a1642a03df497a45667ef8d05fd4dd"
52
52
  }