Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Uses variables instead of raw strings for json query
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlasek committed Feb 27, 2018
1 parent 67b51ea commit 832234a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ open class APIUserControllerDelegate<U: JWTKeychainUser>:
passwordResetMailer: PasswordResetMailerType
) throws -> ResponseRepresentable {
do {

if let json = request.json {
let email: String = try json.get("email")
let email: String = try json.get(User.Keys.email)

try EmailValidator()
.transformingErrors(to: EmailError.invalidEmailFormat)
Expand Down Expand Up @@ -101,7 +100,7 @@ extension APIUserControllerDelegate {
return JSON(["status": .string(status)])
}

enum EmailError: Error {
private enum EmailError: Error {
case invalidEmailFormat
}
}

0 comments on commit 832234a

Please sign in to comment.