Comments (1)
I was experiencing the same and found the following things that could be relevant/the reason (in order of importance):
- Firebase API now throws
FirebaseAuthException
instead ofPlatformException
.
See e.g. the docs of signInWithEmailAndPassword()
and the docs of the exception class
There are different ways the code in this repo can be changed to handle this, one example (the one I'll probably go with for now) is this:
- catch the widest Exception first, e.g. in
EmailPasswordSignInPage
class
} on Exception catch (e) {
_showSignInError(model, e);
}
and forward that for display:
_showSignInError(EmailPasswordSignInModel model, Exception exception)
- in
PlatformExceptionAlertDialog
class that's responsible for the display
PlatformExceptionAlertDialog({String title, Exception exception})
and
static String message(Exception exception) {
if (exception is FirebaseAuthException) {
return errors[exception.code] ?? exception.message;
} else if (exception is PlatformException) {
if (exception.message == 'FIRFirestoreErrorDomain') {
if (exception.code == 'Code 7') {
// This happens when we get a "Missing or insufficient permissions" error
return 'This operation could not be completed due to a server error';
}
return exception.details;
}
return errors[exception.code] ?? exception.message;
} else {
// Note: this could turn out ugly on the UI, (change it if you can't afford that)
// but at least you'll get some feedback
return exception.toString();
}
}
-
Your IDE settings could be "false-catching" the exceptions when you're in debug mode.
Check this on VSCode and on Android Studio for more infos. -
You could have similar side-effects when changing the architecture of the repo, e.g. I found myself trying to simplify things a bit but than too much :D
(I think this is a brilliant repo, but overcomplicated here and there - arguably for the sake of testability, but still.)
On a sidenote:
I'm not sure what the story is with the repo at the moment... Looking at the number and nature of issues it's missing maintenance power, but hopefully just temporarily.
(I might try and do a pull request with point 1. when/if I can, but there are probably other problems that would need assistance too...)
from firebase_auth_demo_flutter.
Related Issues (20)
- Link-based email authentication doesn't work reliably HOT 1
- Using code with new project throws exception HOT 4
- Missing Google Auth Token
- Kindly Add Phone Authentication
- Invalid Dynamic Link - Requested URL must be parsable and complete DynamicLink HOT 1
- Clarification: What does "Add it to the Runner target in Xcode" mean? HOT 1
- Page specific authentication
- Google sign in causes app to crash on iOS HOT 1
- After clicking the activation link, device opens the same app twice
- Consider implementing sign_in_with_apple, a new Flutter Favorite package.
- No implementation found for method isAvailable on channel dev.gilder.tom/apple_sign_in HOT 2
- AuthResult can't be assigned to a variable of type 'FirebaseUSer'
- iOS App Stuck loading when locking/unlocking device after the Google Sign In dialog is shown
- updating for null safety?
- Unhandled Exception: MissingPluginException HOT 1
- After Signin with google(or other), go to SignUp page, no HomePage
- Logout don't rebuild UI HOT 3
- package error HOT 2
- Error when authwidgetbuilder used above material.router
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase_auth_demo_flutter.