return user's own username link handle in /whoami response
This commit is contained in:
parent
befcdf55fe
commit
2d184b1ab6
|
@ -252,6 +252,7 @@ public class AccountController {
|
|||
auth.getAccount().getNumber(),
|
||||
auth.getAccount().getPhoneNumberIdentifier(),
|
||||
auth.getAccount().getUsernameHash().filter(h -> h.length > 0).orElse(null),
|
||||
auth.getAccount().getUsernameLinkHandle(),
|
||||
auth.getAccount().isStorageSupported());
|
||||
}
|
||||
|
||||
|
|
|
@ -150,6 +150,7 @@ public class AccountControllerV2 {
|
|||
updatedAccount.getNumber(),
|
||||
updatedAccount.getPhoneNumberIdentifier(),
|
||||
updatedAccount.getUsernameHash().orElse(null),
|
||||
updatedAccount.getUsernameLinkHandle(),
|
||||
updatedAccount.isStorageSupported());
|
||||
} catch (MismatchedDevicesException e) {
|
||||
throw new WebApplicationException(Response.status(409)
|
||||
|
@ -208,6 +209,7 @@ public class AccountControllerV2 {
|
|||
updatedAccount.getNumber(),
|
||||
updatedAccount.getPhoneNumberIdentifier(),
|
||||
updatedAccount.getUsernameHash().orElse(null),
|
||||
updatedAccount.getUsernameLinkHandle(),
|
||||
updatedAccount.isStorageSupported());
|
||||
} catch (MismatchedDevicesException e) {
|
||||
throw new WebApplicationException(Response.status(409)
|
||||
|
|
|
@ -170,6 +170,7 @@ public class RegistrationController {
|
|||
account.getNumber(),
|
||||
account.getPhoneNumberIdentifier(),
|
||||
account.getUsernameHash().orElse(null),
|
||||
account.getUsernameLinkHandle(),
|
||||
existingAccount.map(Account::isStorageSupported).orElse(false));
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,9 @@ public record AccountIdentityResponse(
|
|||
@JsonDeserialize(using = ByteArrayBase64UrlAdapter.Deserializing.class)
|
||||
@Nullable byte[] usernameHash,
|
||||
|
||||
@Schema(description="this account's username link handle, if set")
|
||||
@Nullable UUID usernameLinkHandle,
|
||||
|
||||
@Schema(description="whether any of this account's devices support storage")
|
||||
boolean storageCapable) {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue