Moved users
This commit is contained in:
parent
78ae1dfe92
commit
f1f6ad2092
4 changed files with 6 additions and 5 deletions
|
@ -30,7 +30,7 @@ class User extends Model {
|
|||
"email": email,
|
||||
"username": username,
|
||||
"password": password,
|
||||
roles: roles
|
||||
"roles": roles
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"]);
|
||||
|
|
|
@ -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) {
|
Loading…
Reference in a new issue