From ebff32952b02ab06d3a635f0ad6ad707a1b9e068 Mon Sep 17 00:00:00 2001 From: "volcano-staging[bot]" <300623176+volcano-staging[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 21:31:07 +0000 Subject: [PATCH] fix: remove access token logging from examples Volcano LavaFlow run 92d3e52c-50ff-4cdb-a041-93ea626acab3. --- content/platform/authentication/quickstart.md | 2 +- content/platform/authentication/volcano-sdk.md | 2 +- content/platform/databases/authentication-flow.md | 4 ++-- content/platform/databases/quick-start.md | 3 +-- content/platform/functions/user-context.md | 3 ++- content/sdk/js/error-handling.md | 6 +++--- content/sdk/js/functions.md | 1 - 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/content/platform/authentication/quickstart.md b/content/platform/authentication/quickstart.md index a75ed514..f77d32e6 100644 --- a/content/platform/authentication/quickstart.md +++ b/content/platform/authentication/quickstart.md @@ -46,7 +46,7 @@ if (error) { } console.log('User created:', user.id); -console.log('Access token:', session.access_token); +console.log('Session started:', Boolean(session)); ``` The response includes the user object and a session with tokens: diff --git a/content/platform/authentication/volcano-sdk.md b/content/platform/authentication/volcano-sdk.md index efe7cf9f..e8d772d0 100644 --- a/content/platform/authentication/volcano-sdk.md +++ b/content/platform/authentication/volcano-sdk.md @@ -323,7 +323,7 @@ if (error) { window.location.href = '/login'; } else { // Session refreshed, new tokens stored automatically - console.log('New access token:', session.access_token); + console.log('Session refreshed, expires in', session.expires_in, 'seconds'); } ``` diff --git a/content/platform/databases/authentication-flow.md b/content/platform/databases/authentication-flow.md index 337c3bb7..80f79e4d 100644 --- a/content/platform/databases/authentication-flow.md +++ b/content/platform/databases/authentication-flow.md @@ -314,7 +314,7 @@ const volcano = new VolcanoAuth({ const pool = volcano.database.createPool({ max: 2 }); exports.handler = async (event) => { - console.log('Event auth context:', event.__volcano_auth); + console.log('Auth user:', event.__volcano_auth?.user_id); // Auth context comes from the user's access token // When user invokes function: @@ -631,7 +631,7 @@ invoke(functionName, payload) ```javascript exports.handler = async (event) => { - console.log('Received event:', event); + console.log('Received action:', event.action); // Event contains: // { diff --git a/content/platform/databases/quick-start.md b/content/platform/databases/quick-start.md index 390bbf61..3fd8c370 100644 --- a/content/platform/databases/quick-start.md +++ b/content/platform/databases/quick-start.md @@ -54,7 +54,7 @@ const { user, session } = await volcano.auth.signUp({ }); console.log('User ID:', user.id); // This is what auth.uid() returns in database -console.log('Access token:', session.access_token); // Automatically used for queries +console.log('Signed in:', Boolean(session)); // The session's access token is automatically used for queries // Or sign in existing user await volcano.auth.signIn({ @@ -217,7 +217,6 @@ const response = await fetch('https://api.yourapp.com/auth/signup', { const { access_token, user } = await response.json(); console.log('User ID:', user.id); -console.log('Access Token:', access_token); // Save access_token for database queries! ``` diff --git a/content/platform/functions/user-context.md b/content/platform/functions/user-context.md index c24b678b..eeb34de4 100644 --- a/content/platform/functions/user-context.md +++ b/content/platform/functions/user-context.md @@ -20,7 +20,7 @@ Functions invoked with an auth user token receive a special `__volcano_auth` obj ```javascript exports.handler = async (event) => { - console.log(event.__volcano_auth); + const auth = event.__volcano_auth; // { // user_id: "550e8400-e29b-41d4-a716-446655440000", // email: "user@example.com", @@ -28,6 +28,7 @@ exports.handler = async (event) => { // role: "authenticated", // access_token: "eyJhbGci..." // } + console.log('User:', auth?.user_id); }; ``` diff --git a/content/sdk/js/error-handling.md b/content/sdk/js/error-handling.md index 666b6134..a8ba1a0f 100644 --- a/content/sdk/js/error-handling.md +++ b/content/sdk/js/error-handling.md @@ -138,12 +138,12 @@ if (AuthRefreshDiscardedError.is(error)) { // Auth state changed while this request was pending. Read the current state // or ask the user to retry; do not automatically replay a mutation. const { data } = await volcano.auth.getSession(); - console.log('Current session:', data.session); + console.log('Has current session:', Boolean(data.session)); } else if (AuthSessionChangedError.is(error)) { // The user response belongs to a session that was replaced while the // request was pending. const { data } = await volcano.auth.getSession(); - console.log('Current session:', data.session); + console.log('Has current session:', Boolean(data.session)); } else if (error) { console.error('Unable to load the user:', error.message); } else { @@ -167,7 +167,7 @@ const { user, error } = await volcano.auth.signIn({ if (AuthSessionChangedError.is(error)) { const { data } = await volcano.auth.getSession(); - console.log('Another auth operation established:', data.session); + console.log('Another auth operation established a session for:', data.session?.user?.id); } else if (error) { console.error('Sign-in failed:', error.message); } else { diff --git a/content/sdk/js/functions.md b/content/sdk/js/functions.md index d38fb56b..de6f1922 100644 --- a/content/sdk/js/functions.md +++ b/content/sdk/js/functions.md @@ -598,7 +598,6 @@ Use `console.log` for debugging - logs appear in the Volcano dashboard: ```javascript exports.handler = async (event) => { - console.log('Function invoked with:', JSON.stringify(event)); console.log('User:', event.__volcano_auth?.user_id); try {