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

Feature: Email validation #110

Merged
merged 3 commits into from
Feb 27, 2018
Merged

Feature: Email validation #110

merged 3 commits into from
Feb 27, 2018

Conversation

martinlasek
Copy link
Contributor

The email provided to reset password is not checked on valid format

@codecov
Copy link

codecov bot commented Feb 23, 2018

Codecov Report

Merging #110 into master will decrease coverage by 0.44%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #110      +/-   ##
=========================================
- Coverage   47.74%   47.3%   -0.45%     
=========================================
  Files          24      24              
  Lines        1066    1076      +10     
  Branches       23      23              
=========================================
  Hits          509     509              
- Misses        557     567      +10
Impacted Files Coverage Δ
...in/Controllers/API/APIUserControllerDelegate.swift 1.75% <0%> (-0.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72d7773...832234a. Read the comment docs.

@steffendsommer
Copy link
Contributor

I will leave this for @siemensikkema as he has better overview of what can be re-used for this new piece of functionality.

@@ -57,6 +59,15 @@ open class APIUserControllerDelegate<U: JWTKeychainUser>:
passwordResetMailer: PasswordResetMailerType
) throws -> ResponseRepresentable {
do {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary newline (?)

@@ -57,6 +59,15 @@ open class APIUserControllerDelegate<U: JWTKeychainUser>:
passwordResetMailer: PasswordResetMailerType
) throws -> ResponseRepresentable {
do {

if let json = request.json {
let email: String = try json.get("email")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget but isn't there a constant for the key "email" somewhere?

@@ -87,4 +100,8 @@ extension APIUserControllerDelegate {
func status(_ status: String) -> ResponseRepresentable {
return JSON(["status": .string(status)])
}

enum EmailError: Error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be private?

@martinlasek martinlasek merged commit 17b5974 into master Feb 27, 2018
@martinlasek martinlasek deleted the feature/email-validation branch February 27, 2018 08:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants