docs: improve expo quickstart. (#18398)

* docs: improve expo quickstart.

* fix: admonition spacing.

* fix: spacing.
This commit is contained in:
Thor 雷神 Schaeff authored and GitHub committed 2023-10-24 02:44:35 +00:00
1 parent 43875eacf4
commit 17d3000ac7
3 files changed
+25 -4

No files matched your search

+1 -1
View File
@@ -31,7 +31,7 @@ Now we are going to set up the database schema. We can use the "User Management
<Admonition type="note">
You can easily pull the database schema down to your local project by running the following commands:
You can easily pull the database schema down to your local project by running the `db pull` command. Read the [local development docs](/docs/guides/cli/local-development#link-your-project) for detailed instructions.
</Admonition>
@@ -373,6 +373,16 @@ supabase db pull
`supabase/migrations` is now populated with a migration in `<timestamp>_remote_schema.sql`.
This migration captures any changes required for your local database to match the schema of your remote Supabase project.
Review the generated migration file and once happy, apply the changes to your local instance:
```bash
# To apply the new migration to your local database:
supabase migration up
# To reset your local database completely:
supabase db reset
```
<Admonition type="note">
There are a few commands required to link your project. We are in the process of consolidating these commands into a single command. Bear with us!
@@ -35,8 +35,7 @@ cd expo-user-management
Then let's install the additional dependencies: [supabase-js](https://github.com/supabase/supabase-js)
```bash
npm install @supabase/supabase-js
npm install react-native-elements @react-native-async-storage/async-storage react-native-url-polyfill
npx expo install @supabase/supabase-js @react-native-async-storage/async-storage react-native-elements react-native-url-polyfill
```
Now let's create a helper file to initialize the Supabase client.
@@ -191,12 +190,16 @@ export default function Auth() {
async function signUpWithEmail() {
setLoading(true)
const { error } = await supabase.auth.signUp({
const {
data: { session },
error,
} = await supabase.auth.signUp({
email: email,
password: password,
})
if (error) Alert.alert(error.message)
if (!session) Alert.alert('Please check your inbox for email verification!')
setLoading(false)
}
@@ -249,6 +252,14 @@ const styles = StyleSheet.create({
})
```
<Admonition type="note">
By default Supabase Auth requires email verification before a session is created for the users. To support email verification you need to [implement deep link handling](/docs/guides/auth/native-mobile-deep-linking?platform=react-native)!
While testing, you can disable email confirmation in your [project's email auth provider settings](/dashboard/project/_/auth/providers).
</Admonition>
### Account page
After a user is signed in we can allow them to edit their profile details and manage their account.