[Identity] Refactor get user_id and device_id
Summary:
This is useful for all authenticated requests, refactor.
Part of: https://linear.app/comm/issue/ENG-4445
Depends on D8605
Test Plan:
cd identity && cargo build
Reviewers: varun, bartek
Reviewed By: bartek
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D8606