[services][identity] subroutine for generating token and writing it to db
Summary:
we have to do this for both wallet and pake login, so moving it to a helper fn to avoid duplicating code
Depends on D4286
Test Plan: cargo build, further testing done in functions that leverage this helper
Reviewers: jimpo, karol-bisztyga, palys-swm
Reviewed By: jimpo, palys-swm
Subscribers: ashoat, Adrian, atul, yayabosh
Differential Revision: https://phab.comm.dev/D4289