Skip to content

ParseUser: store password in field #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ dart:

install:
- git clone https://github.com/flutter/flutter.git -b stable --depth 1
- export PATH=./flutter/bin:$PATH
- export PATH=~/build/parse-community/Parse-SDK-Flutter/flutter/bin:$PATH
- flutter doctor

script:
- (cd packages/dart && dart pub get)
- (cd packages/dart && dart test test/)
- (cd packages/dart && pub get)
- (cd packages/dart && pub run test)
- (cd packages/flutter && flutter pub get)
- (cd packages/flutter && flutter test --no-pub test/)

Expand Down
11 changes: 4 additions & 7 deletions packages/dart/lib/src/objects/parse_user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ParseUser extends ParseObject implements ParseCloneable {
/// Requires [String] username, [String] password. [String] email address
/// is required as well to create a full new user object on ParseServer. Only
/// username and password is required to login
ParseUser(String username, String password, String emailAddress,
ParseUser(String username, this.password, String emailAddress,
{String sessionToken, bool debug, ParseHTTPClient client})
: super(keyClassUser) {
_debug = isDebugEnabled(objectLevelDebug: debug);
Expand All @@ -21,15 +21,14 @@ class ParseUser extends ParseObject implements ParseCloneable {
securityContext: ParseCoreData().securityContext);

this.username = username;
this.password = password;
this.emailAddress = emailAddress;
this.sessionToken = sessionToken;
}

ParseUser.forQuery() : super(keyClassUser);

ParseUser.clone(Map<String, dynamic> map)
: this(map[keyVarUsername], map[keyVarPassword], map[keyVarEmail]);
: this(map[keyVarUsername], null, map[keyVarEmail]);

@override
dynamic clone(Map<String, dynamic> map) =>
Expand All @@ -40,6 +39,8 @@ class ParseUser extends ParseObject implements ParseCloneable {
static const String keyEmailAddress = 'email';
static const String path = '$keyEndPointClasses$keyClassUser';

String password;

Map<String, dynamic> get acl => super.get<Map<String, dynamic>>(keyVarAcl);

set acl(Map<String, dynamic> acl) =>
Expand All @@ -54,10 +55,6 @@ class ParseUser extends ParseObject implements ParseCloneable {

set username(String username) => set<String>(keyVarUsername, username);

String get password => super.get<String>(keyVarPassword);

set password(String password) => set<String>(keyVarPassword, password);

String get emailAddress => super.get<String>(keyVarEmail);

set emailAddress(String emailAddress) =>
Expand Down
5 changes: 2 additions & 3 deletions packages/flutter/lib/parse_server_sdk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ class Parse extends sdk.Parse
parseUserConstructor: parseUserConstructor,
parseFileConstructor: parseFileConstructor,
connectivityProvider: connectivityProvider ?? this,
fileDirectory: fileDirectory ?? !sdk.parseIsWeb
? (await getTemporaryDirectory()).path
: null,
fileDirectory: fileDirectory ??
(!sdk.parseIsWeb ? (await getTemporaryDirectory()).path : null),
appResumedStream: appResumedStream ?? _appResumedStreamController.stream,
);
}
Expand Down