MCPcopy
hub / github.com/adrianhajdin/banking / getLoggedInUser

Function getLoggedInUser

lib/actions/user.actions.ts:108–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106}
107
108export async function getLoggedInUser() {
109 try {
110 const { account } = await createSessionClient();
111 const result = await account.get();
112
113 const user = await getUserInfo({ userId: result.$id})
114
115 return parseStringify(user);
116 } catch (error) {
117 console.log(error)
118 return null;
119 }
120}
121
122export const logoutAccount = async () => {
123 try {

Callers 5

HomeFunction · 0.90
RootLayoutFunction · 0.90
TransactionHistoryFunction · 0.90
TransferFunction · 0.90
MyBanksFunction · 0.90

Calls 3

createSessionClientFunction · 0.90
parseStringifyFunction · 0.90
getUserInfoFunction · 0.85

Tested by

no test coverage detected