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().getNumber(),
|
||||||
auth.getAccount().getPhoneNumberIdentifier(),
|
auth.getAccount().getPhoneNumberIdentifier(),
|
||||||
auth.getAccount().getUsernameHash().filter(h -> h.length > 0).orElse(null),
|
auth.getAccount().getUsernameHash().filter(h -> h.length > 0).orElse(null),
|
||||||
|
auth.getAccount().getUsernameLinkHandle(),
|
||||||
auth.getAccount().isStorageSupported());
|
auth.getAccount().isStorageSupported());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,6 +150,7 @@ public class AccountControllerV2 {
|
||||||
updatedAccount.getNumber(),
|
updatedAccount.getNumber(),
|
||||||
updatedAccount.getPhoneNumberIdentifier(),
|
updatedAccount.getPhoneNumberIdentifier(),
|
||||||
updatedAccount.getUsernameHash().orElse(null),
|
updatedAccount.getUsernameHash().orElse(null),
|
||||||
|
updatedAccount.getUsernameLinkHandle(),
|
||||||
updatedAccount.isStorageSupported());
|
updatedAccount.isStorageSupported());
|
||||||
} catch (MismatchedDevicesException e) {
|
} catch (MismatchedDevicesException e) {
|
||||||
throw new WebApplicationException(Response.status(409)
|
throw new WebApplicationException(Response.status(409)
|
||||||
|
@ -208,6 +209,7 @@ public class AccountControllerV2 {
|
||||||
updatedAccount.getNumber(),
|
updatedAccount.getNumber(),
|
||||||
updatedAccount.getPhoneNumberIdentifier(),
|
updatedAccount.getPhoneNumberIdentifier(),
|
||||||
updatedAccount.getUsernameHash().orElse(null),
|
updatedAccount.getUsernameHash().orElse(null),
|
||||||
|
updatedAccount.getUsernameLinkHandle(),
|
||||||
updatedAccount.isStorageSupported());
|
updatedAccount.isStorageSupported());
|
||||||
} catch (MismatchedDevicesException e) {
|
} catch (MismatchedDevicesException e) {
|
||||||
throw new WebApplicationException(Response.status(409)
|
throw new WebApplicationException(Response.status(409)
|
||||||
|
|
|
@ -170,6 +170,7 @@ public class RegistrationController {
|
||||||
account.getNumber(),
|
account.getNumber(),
|
||||||
account.getPhoneNumberIdentifier(),
|
account.getPhoneNumberIdentifier(),
|
||||||
account.getUsernameHash().orElse(null),
|
account.getUsernameHash().orElse(null),
|
||||||
|
account.getUsernameLinkHandle(),
|
||||||
existingAccount.map(Account::isStorageSupported).orElse(false));
|
existingAccount.map(Account::isStorageSupported).orElse(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,9 @@ public record AccountIdentityResponse(
|
||||||
@JsonDeserialize(using = ByteArrayBase64UrlAdapter.Deserializing.class)
|
@JsonDeserialize(using = ByteArrayBase64UrlAdapter.Deserializing.class)
|
||||||
@Nullable byte[] usernameHash,
|
@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")
|
@Schema(description="whether any of this account's devices support storage")
|
||||||
boolean storageCapable) {
|
boolean storageCapable) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue