Remove post macro from api::core::emergency_access::post_emergency_access or add to routes! #1794

Closed
opened 2025-11-07 07:19:09 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @zacknewman on GitHub (Dec 7, 2023).

Discussed in https://github.com/dani-garcia/vaultwarden/discussions/4076

Originally posted by zacknewman November 16, 2023
api::core::emergency_access::post_emergency_access is only ever used once in put_emergency_access, and the Route is not added by routes! in routes. Three fixes are:

  • add the Route via routes! in routes.
  • Remove the post macro.
  • Remove the function altogether and integrate its body into put_emergency_access.
Originally created by @zacknewman on GitHub (Dec 7, 2023). ### Discussed in https://github.com/dani-garcia/vaultwarden/discussions/4076 <div type='discussions-op-text'> <sup>Originally posted by **zacknewman** November 16, 2023</sup> [`api::core::emergency_access::post_emergency_access`](https://github.com/dani-garcia/vaultwarden/blob/main/src/api/core/emergency_access.rs#L101) is only ever used once in `put_emergency_access`, and the `Route` is not added by `routes!` in `routes`. Three fixes are: * add the `Route` via `routes!` in `routes`. * Remove the `post` macro. * Remove the function altogether and integrate its body into `put_emergency_access`.</div>
Author
Owner

@zacknewman commented on GitHub (Dec 7, 2023):

Based on the most recent PR from @BlackDex, I think this got overlooked due to it being a Discussion and not Issue.

@zacknewman commented on GitHub (Dec 7, 2023): Based on the most recent [PR](https://github.com/dani-garcia/vaultwarden/pull/4143) from @BlackDex, I think this got overlooked due to it being a Discussion and not Issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#1794