Skip to content

Commit

Permalink
docs: better document server and client auth
Browse files Browse the repository at this point in the history
  • Loading branch information
sandros94 committed Jul 8, 2024
1 parent c38ce57 commit 57688d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ NUXT_PUBLIC_SURREALDB_DATABASES_PRODUCTION_NS="surrealdb"
NUXT_PUBLIC_SURREALDB_DATABASES_PRODUCTION_DB="docs"
NUXT_PUBLIC_SURREALDB_DATABASES_PRODUCTION_SC="user"
# For auth
# To add authentication server side (this does not override the client's token)
# As a Bearer
NUXT_PUBLIC_SURREALDB_DATABASES_PRODUCTION_AUTH="mySuperLongBearerToken"
NUXT_SURREALDB_DATABASES_PRODUCTION_AUTH="mySuperLongBearerToken"
# Or as an object
NUXT_PUBLIC_SURREALDB_DATABASES_PRODUCTION_AUTH_USER="root"
NUXT_PUBLIC_SURREALDB_DATABASES_PRODUCTION_AUTH_PASS="root"
NUXT_SURREALDB_DATABASES_PRODUCTION_AUTH_USER="root"
NUXT_SURREALDB_DATABASES_PRODUCTION_AUTH_PASS="root"
```

```ts
Expand All @@ -69,7 +69,7 @@ export default defineNuxtConfig({
NS: 'staging',
DB: 'demo',

// Auth examples
// Auth examples exposed to client side
auth: 'mySuperLongBearerToken',
auth: {
user: 'root',
Expand All @@ -83,7 +83,7 @@ export default defineNuxtConfig({
DB: ''
},
},
server: {
server: { // the following add auth only server side
databases: {
production: {
auth: '', // NUXT_SURREALDB_DATABASES_PRODUCTION_AUTH
Expand Down

0 comments on commit 57688d7

Please sign in to comment.