Add base auth & ucan request flow (web only)
This commit is contained in:
parent
09b78a4634
commit
cef133031e
14 changed files with 1555 additions and 290 deletions
|
@ -14,7 +14,7 @@ export function Home({navigation}: RootTabsScreenProps<'Home'>) {
|
|||
title="Go to Jane's profile"
|
||||
onPress={() => navigation.navigate('Profile', {name: 'Jane'})}
|
||||
/>
|
||||
<Button title="Logout" onPress={() => store.session.setAuthed(false)} />
|
||||
<Button title="Logout" onPress={() => store.session.logout()} />
|
||||
</View>
|
||||
</Shell>
|
||||
)
|
||||
|
|
|
@ -12,14 +12,9 @@ export const Login = observer(({navigation}: RootTabsScreenProps<'Login'>) => {
|
|||
<View style={{justifyContent: 'center', alignItems: 'center'}}>
|
||||
<Text style={{fontSize: 20, fontWeight: 'bold'}}>Sign In</Text>
|
||||
{store.session.uiError ?? <Text>{store.session.uiError}</Text>}
|
||||
{store.session.uiState === 'idle' ? (
|
||||
{!store.session.uiIsProcessing ? (
|
||||
<>
|
||||
{store.session.hasAccount ?? (
|
||||
<Button
|
||||
title="Login"
|
||||
onPress={() => store.session.loadAccount()}
|
||||
/>
|
||||
)}
|
||||
<Button title="Login" onPress={() => store.session.login()} />
|
||||
<Button
|
||||
title="Sign Up"
|
||||
onPress={() => navigation.navigate('Signup')}
|
||||
|
|
|
@ -13,13 +13,11 @@ export const Signup = observer(
|
|||
<View style={{justifyContent: 'center', alignItems: 'center'}}>
|
||||
<Text style={{fontSize: 20, fontWeight: 'bold'}}>Create Account</Text>
|
||||
{store.session.uiError ?? <Text>{store.session.uiError}</Text>}
|
||||
{store.session.uiState === 'idle' ? (
|
||||
{!store.session.uiIsProcessing ? (
|
||||
<>
|
||||
<Button
|
||||
title="Create new account"
|
||||
onPress={() =>
|
||||
store.session.createTestAccount('http://localhost:1986')
|
||||
}
|
||||
onPress={() => store.session.login()}
|
||||
/>
|
||||
<Button
|
||||
title="Log in to an existing account"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue