appwrite / website

The Appwrite website, docs and blog 🏠
https://appwrite.io
171 stars 162 forks source link

đź“š Documentation: Server-side authentication with Nuxt (Nuxt SSR) #795

Open marcbejar opened 3 months ago

marcbejar commented 3 months ago

đź’­ Description

  1. In the Step 3 of the Nuxt SSR example i the function createAdminClient() the process​.env.APPWRITE_ENDPOINT and the process​.env.APPWRITE_ENDPOINT might have the PUBLIC_ prefix, resulting:

    const client = new Client()
    .setEndpoint(process​.env.PUBLIC_APPWRITE_ENDPOINT!)
    .setProject(process​.env.PUBLIC_APPWRITE_PROJECT_ID!)
    .setKey(process​.env.APPWRITE_KEY!);

    Also, maybe it's better to use the useRuntimeConfig() as in the createSessionClient(event) function.

  2. In the .env file the variable PUBLIC_APPWRITE_PROJECT is missing the ID to match the examples mentioned before:

    APPWRITE_KEY=<YOUR_API_KEY>
    PUBLIC_APPWRITE_ENDPOINT=https://cloud.appwrite.io/v1
    PUBLIC_APPWRITE_PROJECT_ID=<YOUR_PROJECT_ID>
  3. In Steps 4, 5 and 6, it says to create api endpoints:

As this both routes results in the same route, maybe its more clear to put them in the same route as /server/api/allApwriteEndpoints or /server/api/appwrite/allAppwriteEndpoints

  1. In the Setp 7, the server/routes/api/oauth2.get.js example code, the commented name file is wrong, the method mentioned is post and shoud be get.

  2. In the Step 6, the file pages/account.vue is giving the following error: useEvent is not defined

đź‘€ Have you spent some time to check if this issue has been raised before?

🏢 Have you read the Code of Conduct?

EVDOG4LIFE commented 3 months ago

@marcbejar - thanks for opening this issue and providing this feedback.

@gewenyu99 - can you take a look?