[#3602] use the auth collection name in the OAuth2 examples

This commit is contained in:
Gani Georgiev
2023-10-25 22:18:18 +03:00
parent d8a1875f84
commit e2d8028d0a
32 changed files with 157 additions and 157 deletions
@@ -74,10 +74,10 @@
// OAuth2 authentication with a single realtime call.
//
// Make sure to register ${backendAbsUrl}/api/oauth2-redirect as redirect url.
const authData = await pb.collection('users').authWithOAuth2({ provider: 'google' });
const authData = await pb.collection('${collection.name}').authWithOAuth2({ provider: 'google' });
// OR authenticate with manual OAuth2 code exchange
// const authData = await pb.collection('users').authWithOAuth2Code(...);
// const authData = await pb.collection('${collection.name}').authWithOAuth2Code(...);
// after the above you can also access the auth data from the authStore
console.log(pb.authStore.isValid);
@@ -98,12 +98,12 @@
// OAuth2 authentication with a single realtime call.
//
// Make sure to register ${backendAbsUrl}/api/oauth2-redirect as redirect url.
final authData = await pb.collection('users').authWithOAuth2('google', (url) async {
final authData = await pb.collection('${collection.name}').authWithOAuth2('google', (url) async {
await launchUrl(url);
});
// OR authenticate with manual OAuth2 code exchange
// final authData = await pb.collection('users').authWithOAuth2Code(...);
// final authData = await pb.collection('${collection.name}').authWithOAuth2Code(...);
// after the above you can also access the auth data from the authStore
print(pb.authStore.isValid);