Don't allow callers to unlink their primary device

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2023-09-11 14:29:48 -04:00
1 parent 845fc338d7
commit 2b764c2abd
1 file changed
+4
@@ -141,6 +141,10 @@ public class DeviceController {
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
}
if (deviceId == Device.MASTER_ID) {
throw new ForbiddenException();
}
final CompletableFuture<Void> deleteKeysFuture = keys.delete(account.getUuid(), deviceId);
messages.clear(account.getUuid(), deviceId).join();