wip: working, needs some unit tests for auth functions

This commit is contained in:
Loewy
2024-02-06 11:09:22 -08:00
parent d93d73dc3a
commit eb2534ff94
5 changed files with 31 additions and 22 deletions

View File

@@ -0,0 +1,18 @@
import { handleSignOut } from "../../auth"
import { useAuthHeader } from "../../graphql/client"
import React from "react"
import { Button } from "react-native"
export default function SignOutButton(): React.JSX.Element {
const { setAuthHeader } = useAuthHeader()
return (
<Button
title={'Sign out'}
onPress={async () => {
setAuthHeader({ key: 'Authorization', value: '' })
await handleSignOut()
}}
/>
)
}