diff options
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/mobile/app/signin.tsx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/mobile/app/signin.tsx b/apps/mobile/app/signin.tsx index 00295cf4..94a57822 100644 --- a/apps/mobile/app/signin.tsx +++ b/apps/mobile/app/signin.tsx @@ -7,6 +7,7 @@ import { View, } from "react-native"; import { Redirect, useRouter } from "expo-router"; +import * as WebBrowser from "expo-web-browser"; import Logo from "@/components/Logo"; import { TailwindResolver } from "@/components/TailwindResolver"; import { Button } from "@/components/ui/Button"; @@ -27,7 +28,6 @@ export default function Signin() { const { settings, setSettings } = useAppSettings(); const router = useRouter(); const api = useTRPC(); - const [error, setError] = useState<string | undefined>(); const [loginType, setLoginType] = useState<LoginType>(LoginType.Password); @@ -82,6 +82,13 @@ export default function Signin() { return <Redirect href="dashboard" />; } + const onSignUp = async () => { + const serverAddress = settings.address ?? "https://cloud.karakeep.app"; + const signupUrl = `${serverAddress}/signup?redirectUrl=${encodeURIComponent("karakeep://signin")}`; + + await WebBrowser.openAuthSessionAsync(signupUrl, "karakeep://signin"); + }; + const onSignin = () => { if (!settings.address) { setError("Server address is required"); @@ -228,6 +235,12 @@ export default function Signin() { : "Use password instead?"} </Text> </Pressable> + <Pressable onPress={onSignUp}> + <Text className="mt-4 text-center text-gray-500"> + Don't have an account?{" "} + <Text className="text-foreground underline">Sign Up</Text> + </Text> + </Pressable> </View> </TouchableWithoutFeedback> </KeyboardAvoidingView> |
