You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you can see, all this does is attempts reading the value, and returns null if it fails. This is extremely useful in building web sites with Dart Frog as many routes are accessible for both authenticated and unauthenticated users, they just render differently. This supports a much nicer flow to access that data.
final user = context.tryRead<User>();
if (user ==null) {
print('unauthenticated');
} else {
print('authenticated');
}
Requirements
All CI/CD checks are passing.
There is no drop in the test coverage percentage.
Change is documented in the dependency injection docs
Additional Context
No response
The text was updated successfully, but these errors were encountered:
Description
I have a handy extension written in all my Dart Frog projects that I believe is a good candidate for the main framework.
As you can see, all this does is attempts reading the value, and returns null if it fails. This is extremely useful in building web sites with Dart Frog as many routes are accessible for both authenticated and unauthenticated users, they just render differently. This supports a much nicer flow to access that data.
Requirements
Additional Context
No response
The text was updated successfully, but these errors were encountered: