From 3b692843bdd67843de477e51a53fec104c5e44dd Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Fri, 27 Sep 2024 16:28:01 +0200 Subject: [PATCH] Uses correct module for OAuth clients in the docs (#2309) --- web/docs/auth/auth-hooks.md | 6 +++--- web/versioned_docs/version-0.14.0/auth/auth-hooks.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/docs/auth/auth-hooks.md b/web/docs/auth/auth-hooks.md index 69937590e..75b711b2c 100644 --- a/web/docs/auth/auth-hooks.md +++ b/web/docs/auth/auth-hooks.md @@ -529,7 +529,7 @@ Some OAuth providers support refreshing the access token when it expires. To ref Wasp exposes the OAuth refresh token in the `onAfterSignup` and `onAfterLogin` hooks. You can store the refresh token in your database and use it to refresh the access token when it expires. -Import the provider object with the OAuth client from the `wasp/server/oauth` module. For example, to refresh the Google OAuth access token, import the `google` object from the `wasp/server/oauth` module. You use the `refreshAccessToken` method of the OAuth client to refresh the access token. +Import the provider object with the OAuth client from the `wasp/server/auth` module. For example, to refresh the Google OAuth access token, import the `google` object from the `wasp/server/auth` module. You use the `refreshAccessToken` method of the OAuth client to refresh the access token. Here's an example of how you can refresh the access token for Google OAuth: @@ -538,7 +538,7 @@ Here's an example of how you can refresh the access token for Google OAuth: ```js title="src/auth/hooks.js" -import { google } from 'wasp/server/oauth' +import { google } from 'wasp/server/auth' export const onAfterLogin = async ({ oauth }) => { if (oauth.provider === 'google' && oauth.tokens.refreshToken !== null) { @@ -556,7 +556,7 @@ export const onAfterLogin = async ({ oauth }) => { ```ts title="src/auth/hooks.ts" import type { OnAfterLoginHook } from 'wasp/server/auth' -import { google } from 'wasp/server/oauth' +import { google } from 'wasp/server/auth' export const onAfterLogin: OnAfterLoginHook = async ({ oauth }) => { if (oauth.provider === 'google' && oauth.tokens.refreshToken !== null) { diff --git a/web/versioned_docs/version-0.14.0/auth/auth-hooks.md b/web/versioned_docs/version-0.14.0/auth/auth-hooks.md index 69937590e..75b711b2c 100644 --- a/web/versioned_docs/version-0.14.0/auth/auth-hooks.md +++ b/web/versioned_docs/version-0.14.0/auth/auth-hooks.md @@ -529,7 +529,7 @@ Some OAuth providers support refreshing the access token when it expires. To ref Wasp exposes the OAuth refresh token in the `onAfterSignup` and `onAfterLogin` hooks. You can store the refresh token in your database and use it to refresh the access token when it expires. -Import the provider object with the OAuth client from the `wasp/server/oauth` module. For example, to refresh the Google OAuth access token, import the `google` object from the `wasp/server/oauth` module. You use the `refreshAccessToken` method of the OAuth client to refresh the access token. +Import the provider object with the OAuth client from the `wasp/server/auth` module. For example, to refresh the Google OAuth access token, import the `google` object from the `wasp/server/auth` module. You use the `refreshAccessToken` method of the OAuth client to refresh the access token. Here's an example of how you can refresh the access token for Google OAuth: @@ -538,7 +538,7 @@ Here's an example of how you can refresh the access token for Google OAuth: ```js title="src/auth/hooks.js" -import { google } from 'wasp/server/oauth' +import { google } from 'wasp/server/auth' export const onAfterLogin = async ({ oauth }) => { if (oauth.provider === 'google' && oauth.tokens.refreshToken !== null) { @@ -556,7 +556,7 @@ export const onAfterLogin = async ({ oauth }) => { ```ts title="src/auth/hooks.ts" import type { OnAfterLoginHook } from 'wasp/server/auth' -import { google } from 'wasp/server/oauth' +import { google } from 'wasp/server/auth' export const onAfterLogin: OnAfterLoginHook = async ({ oauth }) => { if (oauth.provider === 'google' && oauth.tokens.refreshToken !== null) {