Don't allow callers to unlink their primary device
This commit is contained in:
parent
845fc338d7
commit
2b764c2abd
|
@ -141,6 +141,10 @@ public class DeviceController {
|
||||||
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
|
throw new WebApplicationException(Response.Status.UNAUTHORIZED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (deviceId == Device.MASTER_ID) {
|
||||||
|
throw new ForbiddenException();
|
||||||
|
}
|
||||||
|
|
||||||
final CompletableFuture<Void> deleteKeysFuture = keys.delete(account.getUuid(), deviceId);
|
final CompletableFuture<Void> deleteKeysFuture = keys.delete(account.getUuid(), deviceId);
|
||||||
|
|
||||||
messages.clear(account.getUuid(), deviceId).join();
|
messages.clear(account.getUuid(), deviceId).join();
|
||||||
|
|
Loading…
Reference in New Issue