Skip to content

Commit

Permalink
chore: username undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Burtey committed Oct 9, 2023
1 parent 2432ba6 commit eed3bd0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/api/src/app/payments/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const recipientDetailsFromInvoice = async <R extends WalletCurrency>(
recipientWalletDescriptors: AccountWalletDescriptors
pubkey: Pubkey
usdPaymentAmount: UsdPaymentAmount | undefined
username: Username
username: Username | undefined
userId: UserId
}
| ApplicationError
Expand Down
2 changes: 1 addition & 1 deletion core/api/src/domain/accounts/index.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ type Account = {
readonly id: AccountId
readonly uuid: AccountUuid
readonly createdAt: Date
username: Username
username?: Username | undefined
defaultWalletId: WalletId
withdrawFee: Satoshis // TODO: make it optional. only save when not default value from yaml
level: AccountLevel
Expand Down
4 changes: 3 additions & 1 deletion core/api/src/servers/graphql-main-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ const setGqlContext = async (

req.gqlContext = gqlContext

const username = "domainAccount" in gqlContext && gqlContext.domainAccount?.username

return addAttributesToCurrentSpanAndPropagate(
{
"token.iss": tokenPayload?.iss,
"token.session_id": tokenPayload?.session_id,
"token.expires_at": tokenPayload?.expires_at,
[SemanticAttributes.HTTP_CLIENT_IP]: ip,
[SemanticAttributes.HTTP_USER_AGENT]: req.headers["user-agent"],
[ACCOUNT_USERNAME]: gqlContext?.domainAccount?.username,
[ACCOUNT_USERNAME]: username,
[SemanticAttributes.ENDUSER_ID]: tokenPayload?.sub,
},
next,
Expand Down

0 comments on commit eed3bd0

Please sign in to comment.