From ad35558c6e147121d2053510098fb2cb445eda5a Mon Sep 17 00:00:00 2001 From: Marcelo Soares Date: Thu, 12 Feb 2026 13:20:46 -0300 Subject: [PATCH] fix: Fix reference of `authenticated` and `isUserSignedIn` as async on Serverpod 3.x --- docs/06-concepts/01-working-with-endpoints.md | 2 +- docs/06-concepts/11-authentication/02-basics.md | 6 +++--- .../version-3.0.0/06-concepts/01-working-with-endpoints.md | 2 +- .../06-concepts/11-authentication/02-basics.md | 6 +++--- .../version-3.1.0/06-concepts/01-working-with-endpoints.md | 2 +- .../06-concepts/11-authentication/02-basics.md | 6 +++--- .../version-3.2.0/06-concepts/01-working-with-endpoints.md | 2 +- .../06-concepts/11-authentication/02-basics.md | 6 +++--- .../version-3.3.0/06-concepts/01-working-with-endpoints.md | 2 +- .../06-concepts/11-authentication/02-basics.md | 6 +++--- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/06-concepts/01-working-with-endpoints.md b/docs/06-concepts/01-working-with-endpoints.md index 8c48278b..f1fba72c 100644 --- a/docs/06-concepts/01-working-with-endpoints.md +++ b/docs/06-concepts/01-working-with-endpoints.md @@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server: ```dart abstract class AuthSessionEndpoint extends Endpoint { Future isAuthenticated(Session session) async { - return await session.isUserSignedIn; + return session.isUserSignedIn; } Future logout(Session session, {required bool allSessions}) async { diff --git a/docs/06-concepts/11-authentication/02-basics.md b/docs/06-concepts/11-authentication/02-basics.md index e65ec85e..41202243 100644 --- a/docs/06-concepts/11-authentication/02-basics.md +++ b/docs/06-concepts/11-authentication/02-basics.md @@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user ```dart Future myMethod(Session session) async { - final authenticationInfo = await session.authenticated; + final authenticationInfo = session.authenticated; final userIdentifier = authenticationInfo?.userIdentifier; ... } @@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated: ```dart Future myMethod(Session session) async { - var isSignedIn = await session.isUserSignedIn; + var isSignedIn = session.isUserSignedIn; ... } ``` @@ -62,7 +62,7 @@ You can use this annotation in two ways: } Stream someStream(Session session) async* { - yield await session.isUserSignedIn; // Will always return false + yield session.isUserSignedIn; // Will always return false } } ``` diff --git a/versioned_docs/version-3.0.0/06-concepts/01-working-with-endpoints.md b/versioned_docs/version-3.0.0/06-concepts/01-working-with-endpoints.md index 8c48278b..f1fba72c 100644 --- a/versioned_docs/version-3.0.0/06-concepts/01-working-with-endpoints.md +++ b/versioned_docs/version-3.0.0/06-concepts/01-working-with-endpoints.md @@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server: ```dart abstract class AuthSessionEndpoint extends Endpoint { Future isAuthenticated(Session session) async { - return await session.isUserSignedIn; + return session.isUserSignedIn; } Future logout(Session session, {required bool allSessions}) async { diff --git a/versioned_docs/version-3.0.0/06-concepts/11-authentication/02-basics.md b/versioned_docs/version-3.0.0/06-concepts/11-authentication/02-basics.md index 8da0d1bd..4ae1ede4 100644 --- a/versioned_docs/version-3.0.0/06-concepts/11-authentication/02-basics.md +++ b/versioned_docs/version-3.0.0/06-concepts/11-authentication/02-basics.md @@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user ```dart Future myMethod(Session session) async { - final authenticationInfo = await session.authenticated; + final authenticationInfo = session.authenticated; final userIdentifier = authenticationInfo?.userIdentifier; ... } @@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated: ```dart Future myMethod(Session session) async { - var isSignedIn = await session.isUserSignedIn; + var isSignedIn = session.isUserSignedIn; ... } ``` @@ -62,7 +62,7 @@ You can use this annotation in two ways: } Stream someStream(Session session) async* { - yield await session.isUserSignedIn; // Will always return false + yield session.isUserSignedIn; // Will always return false } } ``` diff --git a/versioned_docs/version-3.1.0/06-concepts/01-working-with-endpoints.md b/versioned_docs/version-3.1.0/06-concepts/01-working-with-endpoints.md index 8c48278b..f1fba72c 100644 --- a/versioned_docs/version-3.1.0/06-concepts/01-working-with-endpoints.md +++ b/versioned_docs/version-3.1.0/06-concepts/01-working-with-endpoints.md @@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server: ```dart abstract class AuthSessionEndpoint extends Endpoint { Future isAuthenticated(Session session) async { - return await session.isUserSignedIn; + return session.isUserSignedIn; } Future logout(Session session, {required bool allSessions}) async { diff --git a/versioned_docs/version-3.1.0/06-concepts/11-authentication/02-basics.md b/versioned_docs/version-3.1.0/06-concepts/11-authentication/02-basics.md index 8da0d1bd..4ae1ede4 100644 --- a/versioned_docs/version-3.1.0/06-concepts/11-authentication/02-basics.md +++ b/versioned_docs/version-3.1.0/06-concepts/11-authentication/02-basics.md @@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user ```dart Future myMethod(Session session) async { - final authenticationInfo = await session.authenticated; + final authenticationInfo = session.authenticated; final userIdentifier = authenticationInfo?.userIdentifier; ... } @@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated: ```dart Future myMethod(Session session) async { - var isSignedIn = await session.isUserSignedIn; + var isSignedIn = session.isUserSignedIn; ... } ``` @@ -62,7 +62,7 @@ You can use this annotation in two ways: } Stream someStream(Session session) async* { - yield await session.isUserSignedIn; // Will always return false + yield session.isUserSignedIn; // Will always return false } } ``` diff --git a/versioned_docs/version-3.2.0/06-concepts/01-working-with-endpoints.md b/versioned_docs/version-3.2.0/06-concepts/01-working-with-endpoints.md index 8c48278b..f1fba72c 100644 --- a/versioned_docs/version-3.2.0/06-concepts/01-working-with-endpoints.md +++ b/versioned_docs/version-3.2.0/06-concepts/01-working-with-endpoints.md @@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server: ```dart abstract class AuthSessionEndpoint extends Endpoint { Future isAuthenticated(Session session) async { - return await session.isUserSignedIn; + return session.isUserSignedIn; } Future logout(Session session, {required bool allSessions}) async { diff --git a/versioned_docs/version-3.2.0/06-concepts/11-authentication/02-basics.md b/versioned_docs/version-3.2.0/06-concepts/11-authentication/02-basics.md index 8da0d1bd..4ae1ede4 100644 --- a/versioned_docs/version-3.2.0/06-concepts/11-authentication/02-basics.md +++ b/versioned_docs/version-3.2.0/06-concepts/11-authentication/02-basics.md @@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user ```dart Future myMethod(Session session) async { - final authenticationInfo = await session.authenticated; + final authenticationInfo = session.authenticated; final userIdentifier = authenticationInfo?.userIdentifier; ... } @@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated: ```dart Future myMethod(Session session) async { - var isSignedIn = await session.isUserSignedIn; + var isSignedIn = session.isUserSignedIn; ... } ``` @@ -62,7 +62,7 @@ You can use this annotation in two ways: } Stream someStream(Session session) async* { - yield await session.isUserSignedIn; // Will always return false + yield session.isUserSignedIn; // Will always return false } } ``` diff --git a/versioned_docs/version-3.3.0/06-concepts/01-working-with-endpoints.md b/versioned_docs/version-3.3.0/06-concepts/01-working-with-endpoints.md index 8c48278b..f1fba72c 100644 --- a/versioned_docs/version-3.3.0/06-concepts/01-working-with-endpoints.md +++ b/versioned_docs/version-3.3.0/06-concepts/01-working-with-endpoints.md @@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server: ```dart abstract class AuthSessionEndpoint extends Endpoint { Future isAuthenticated(Session session) async { - return await session.isUserSignedIn; + return session.isUserSignedIn; } Future logout(Session session, {required bool allSessions}) async { diff --git a/versioned_docs/version-3.3.0/06-concepts/11-authentication/02-basics.md b/versioned_docs/version-3.3.0/06-concepts/11-authentication/02-basics.md index e65ec85e..41202243 100644 --- a/versioned_docs/version-3.3.0/06-concepts/11-authentication/02-basics.md +++ b/versioned_docs/version-3.3.0/06-concepts/11-authentication/02-basics.md @@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user ```dart Future myMethod(Session session) async { - final authenticationInfo = await session.authenticated; + final authenticationInfo = session.authenticated; final userIdentifier = authenticationInfo?.userIdentifier; ... } @@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated: ```dart Future myMethod(Session session) async { - var isSignedIn = await session.isUserSignedIn; + var isSignedIn = session.isUserSignedIn; ... } ``` @@ -62,7 +62,7 @@ You can use this annotation in two ways: } Stream someStream(Session session) async* { - yield await session.isUserSignedIn; // Will always return false + yield session.isUserSignedIn; // Will always return false } } ```