diff --git a/lib/src/models/user.dart b/lib/src/models/user.dart index 5c3ce41..332affe 100644 --- a/lib/src/models/user.dart +++ b/lib/src/models/user.dart @@ -30,7 +30,7 @@ class User extends Model { "email": email, "username": username, "password": password, - roles: roles + "roles": roles }; } } diff --git a/lib/src/routes/controllers/auth.dart b/lib/src/routes/controllers/auth.dart index 35972ce..236da37 100644 --- a/lib/src/routes/controllers/auth.dart +++ b/lib/src/routes/controllers/auth.dart @@ -2,7 +2,7 @@ library angel.routes.controllers.auth; import 'package:angel_auth/angel_auth.dart'; import 'package:angel_framework/angel_framework.dart'; -import '../../services/user/user.dart'; +import '../../services/user.dart'; @Expose("/auth") class AuthController extends Controller { diff --git a/lib/src/services/services.dart b/lib/src/services/services.dart index 966bf38..8cc3c9b 100644 --- a/lib/src/services/services.dart +++ b/lib/src/services/services.dart @@ -4,7 +4,7 @@ library angel.services; import 'package:angel_framework/angel_framework.dart'; import 'package:mongo_dart/mongo_dart.dart'; -import 'user/user.dart' as User; +import 'user.dart' as User; configureServer(Angel app) async { Db db = new Db(app.properties["mongo_db"]); diff --git a/lib/src/services/user/user.dart b/lib/src/services/user.dart similarity index 94% rename from lib/src/services/user/user.dart rename to lib/src/services/user.dart index 358d361..d59199d 100644 --- a/lib/src/services/user/user.dart +++ b/lib/src/services/user.dart @@ -3,8 +3,8 @@ import 'package:angel_mongo/angel_mongo.dart'; import 'package:crypto/crypto.dart' show sha256; import 'package:mongo_dart/mongo_dart.dart'; import 'package:validate/validate.dart'; -import '../../models/user.dart'; -export '../../models/user.dart'; +import '../models/user.dart'; +export '../models/user.dart'; configureServer(Db db) { return (Angel app) async { @@ -49,6 +49,7 @@ class UserService extends Service { try { Validate.isKeyInMap("username", data); + Validate.isKeyInMap("password", data); Validate.isEmail(data["email"]); data["password"] = hashPassword(data["password"]); } catch (e) {