()
| 106 | } |
| 107 | |
| 108 | export 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 | |
| 122 | export const logoutAccount = async () => { |
| 123 | try { |
no test coverage detected