Skip to content

Commit

Permalink
feat(uphf): add reload account
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-theret committed Oct 7, 2024
1 parent d2587ee commit 0d36e20
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/services/uphf/reload-uphf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { UphfAccount } from "@/stores/account/types";
import type { Reconnected } from "../reload-account";
import { authWithRefreshToken } from "uphf-api";

export const reloadInstance = async (authentication: UphfAccount["authentication"]): Promise<Reconnected<UphfAccount>> => {
const session = await authWithRefreshToken({ refreshAuthToken: authentication.refreshAuthToken });

return {
instance: session,
authentication: {
refreshAuthToken: session.userData.refreshAuthToken
}
};
};

0 comments on commit 0d36e20

Please sign in to comment.