[#3602] use the auth collection name in the OAuth2 examples
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user