Skip to content
This repository has been archived by the owner on Mar 18, 2021. It is now read-only.

Fixing some naming and ordering in template #150

Merged
merged 2 commits into from
Dec 7, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import '../wildfire.dart';
class RegisterController extends QueryController<User> {
@httpPost
createUser() async {
if (query.values.username == null || query.values.password == null) {
if (query.values.email == null || query.values.password == null) {
return new Response.badRequest(
body: {"error": "Username and password required."});
body: {"error": "email and password required."});
}
var credentials = AuthorizationBasicParser
.parse(request.innerRequest.headers.value(HttpHeaders.AUTHORIZATION));

var salt = AuthServer.generateRandomSalt();
var hashedPassword =
Expand All @@ -15,9 +17,6 @@ class RegisterController extends QueryController<User> {
query.values.salt = salt;

var u = await query.insert();

var credentials = AuthorizationBasicParser
.parse(request.innerRequest.headers.value(HttpHeaders.AUTHORIZATION));
var token = await request.authorization.grantingServer.authenticate(
u.username,
query.values.password,
Expand Down
4 changes: 2 additions & 2 deletions test/base/recovery_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main() {
var errorMessage = await app.logger.onRecord.first;
expect(errorMessage.message, contains("Uncaught exception"));
expect(
errorMessage.error.toString(), contains("method not found: 'foo'"));
errorMessage.error.toString(), contains("foo"));
expect(errorMessage.stackTrace, isNotNull);

// And then we should make sure everything is working just fine.
Expand All @@ -51,7 +51,7 @@ main() {
logMessages.forEach((errorMessage) {
expect(errorMessage.message, contains("Uncaught exception"));
expect(
errorMessage.error.toString(), contains("method not found: 'foo'"));
errorMessage.error.toString(), contains("foo"));
expect(errorMessage.stackTrace, isNotNull);
});

Expand Down