Skip to content

Commit d016d05

Browse files
fix: Fix reference of authenticated and isUserSignedIn as async on Serverpod 3.x (#417)
1 parent a038a3d commit d016d05

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
lines changed

docs/06-concepts/01-working-with-endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server:
418418
```dart
419419
abstract class AuthSessionEndpoint extends Endpoint {
420420
Future<bool> isAuthenticated(Session session) async {
421-
return await session.isUserSignedIn;
421+
return session.isUserSignedIn;
422422
}
423423
424424
Future<bool> logout(Session session, {required bool allSessions}) async {

docs/06-concepts/11-authentication/02-basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user
66

77
```dart
88
Future<void> myMethod(Session session) async {
9-
final authenticationInfo = await session.authenticated;
9+
final authenticationInfo = session.authenticated;
1010
final userIdentifier = authenticationInfo?.userIdentifier;
1111
...
1212
}
@@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated:
1616

1717
```dart
1818
Future<void> myMethod(Session session) async {
19-
var isSignedIn = await session.isUserSignedIn;
19+
var isSignedIn = session.isUserSignedIn;
2020
...
2121
}
2222
```
@@ -62,7 +62,7 @@ You can use this annotation in two ways:
6262
}
6363
6464
Stream<bool> someStream(Session session) async* {
65-
yield await session.isUserSignedIn; // Will always return false
65+
yield session.isUserSignedIn; // Will always return false
6666
}
6767
}
6868
```

versioned_docs/version-3.0.0/06-concepts/01-working-with-endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server:
418418
```dart
419419
abstract class AuthSessionEndpoint extends Endpoint {
420420
Future<bool> isAuthenticated(Session session) async {
421-
return await session.isUserSignedIn;
421+
return session.isUserSignedIn;
422422
}
423423
424424
Future<bool> logout(Session session, {required bool allSessions}) async {

versioned_docs/version-3.0.0/06-concepts/11-authentication/02-basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user
66

77
```dart
88
Future<void> myMethod(Session session) async {
9-
final authenticationInfo = await session.authenticated;
9+
final authenticationInfo = session.authenticated;
1010
final userIdentifier = authenticationInfo?.userIdentifier;
1111
...
1212
}
@@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated:
1616

1717
```dart
1818
Future<void> myMethod(Session session) async {
19-
var isSignedIn = await session.isUserSignedIn;
19+
var isSignedIn = session.isUserSignedIn;
2020
...
2121
}
2222
```
@@ -62,7 +62,7 @@ You can use this annotation in two ways:
6262
}
6363
6464
Stream<bool> someStream(Session session) async* {
65-
yield await session.isUserSignedIn; // Will always return false
65+
yield session.isUserSignedIn; // Will always return false
6666
}
6767
}
6868
```

versioned_docs/version-3.1.0/06-concepts/01-working-with-endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server:
418418
```dart
419419
abstract class AuthSessionEndpoint extends Endpoint {
420420
Future<bool> isAuthenticated(Session session) async {
421-
return await session.isUserSignedIn;
421+
return session.isUserSignedIn;
422422
}
423423
424424
Future<bool> logout(Session session, {required bool allSessions}) async {

versioned_docs/version-3.1.0/06-concepts/11-authentication/02-basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user
66

77
```dart
88
Future<void> myMethod(Session session) async {
9-
final authenticationInfo = await session.authenticated;
9+
final authenticationInfo = session.authenticated;
1010
final userIdentifier = authenticationInfo?.userIdentifier;
1111
...
1212
}
@@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated:
1616

1717
```dart
1818
Future<void> myMethod(Session session) async {
19-
var isSignedIn = await session.isUserSignedIn;
19+
var isSignedIn = session.isUserSignedIn;
2020
...
2121
}
2222
```
@@ -62,7 +62,7 @@ You can use this annotation in two ways:
6262
}
6363
6464
Stream<bool> someStream(Session session) async* {
65-
yield await session.isUserSignedIn; // Will always return false
65+
yield session.isUserSignedIn; // Will always return false
6666
}
6767
}
6868
```

versioned_docs/version-3.2.0/06-concepts/01-working-with-endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server:
418418
```dart
419419
abstract class AuthSessionEndpoint extends Endpoint {
420420
Future<bool> isAuthenticated(Session session) async {
421-
return await session.isUserSignedIn;
421+
return session.isUserSignedIn;
422422
}
423423
424424
Future<bool> logout(Session session, {required bool allSessions}) async {

versioned_docs/version-3.2.0/06-concepts/11-authentication/02-basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user
66

77
```dart
88
Future<void> myMethod(Session session) async {
9-
final authenticationInfo = await session.authenticated;
9+
final authenticationInfo = session.authenticated;
1010
final userIdentifier = authenticationInfo?.userIdentifier;
1111
...
1212
}
@@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated:
1616

1717
```dart
1818
Future<void> myMethod(Session session) async {
19-
var isSignedIn = await session.isUserSignedIn;
19+
var isSignedIn = session.isUserSignedIn;
2020
...
2121
}
2222
```
@@ -62,7 +62,7 @@ You can use this annotation in two ways:
6262
}
6363
6464
Stream<bool> someStream(Session session) async* {
65-
yield await session.isUserSignedIn; // Will always return false
65+
yield session.isUserSignedIn; // Will always return false
6666
}
6767
}
6868
```

versioned_docs/version-3.3.0/06-concepts/01-working-with-endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ Declare an abstract endpoint with common methods on the server:
418418
```dart
419419
abstract class AuthSessionEndpoint extends Endpoint {
420420
Future<bool> isAuthenticated(Session session) async {
421-
return await session.isUserSignedIn;
421+
return session.isUserSignedIn;
422422
}
423423
424424
Future<bool> logout(Session session, {required bool allSessions}) async {

versioned_docs/version-3.3.0/06-concepts/11-authentication/02-basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The `Session` object provides information about the current user. A unique `user
66

77
```dart
88
Future<void> myMethod(Session session) async {
9-
final authenticationInfo = await session.authenticated;
9+
final authenticationInfo = session.authenticated;
1010
final userIdentifier = authenticationInfo?.userIdentifier;
1111
...
1212
}
@@ -16,7 +16,7 @@ You can also use the Session object to check if a user is authenticated:
1616

1717
```dart
1818
Future<void> myMethod(Session session) async {
19-
var isSignedIn = await session.isUserSignedIn;
19+
var isSignedIn = session.isUserSignedIn;
2020
...
2121
}
2222
```
@@ -62,7 +62,7 @@ You can use this annotation in two ways:
6262
}
6363
6464
Stream<bool> someStream(Session session) async* {
65-
yield await session.isUserSignedIn; // Will always return false
65+
yield session.isUserSignedIn; // Will always return false
6666
}
6767
}
6868
```

0 commit comments

Comments
 (0)