Skip to content

Commit e8e1bb6

Browse files
authored
allow signup without email (#469)
1 parent 583bfb8 commit e8e1bb6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/dart/lib/src/objects/parse_user.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,20 @@ class ParseUser extends ParseObject implements ParseCloneable {
141141
///
142142
/// After creating a new user via [Parse.create] call this method to register
143143
/// that user on Parse
144-
Future<ParseResponse> signUp() async {
144+
/// By setting [allowWithoutEmail] to `true`, you can sign up without setting an email
145+
Future<ParseResponse> signUp({bool allowWithoutEmail = false}) async {
145146
forgetLocalSession();
146147

147148
try {
148149
if (emailAddress == null) {
149-
return null;
150+
if (!allowWithoutEmail) {
151+
return null;
152+
} else {
153+
assert(() {
154+
print('It is recommended to only allow user signUp with a ');
155+
return true;
156+
}());
157+
}
150158
}
151159

152160
final Map<String, dynamic> bodyData = _getObjectData();

0 commit comments

Comments
 (0)