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

Commit

Permalink
Merge pull request #45 from nodes-vapor/bug/password-hash
Browse files Browse the repository at this point in the history
Fixed bug where password wasn't being hashed
  • Loading branch information
BrettRToomey authored Feb 16, 2017
2 parents 6a490ef + 4ae2df2 commit 90ba133
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Sources/JWTKeychain/Models/Users/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ public final class User: UserType {
public var createdAt: Date?
public var updatedAt: Date?
public var deletedAt: Date?



/// Initializes the User with name, email and password (plain)
///
/// - Parameters:
/// - validated: an instance of `StoreRequest` that has a name, email and password.
public required init(validated: StoreRequest) {
name = validated.name
email = validated.email
password = validated.password
password = BCrypt.hash(password: validated.password)
createdAt = Date()
updatedAt = Date()
}

/// Initializes the User with name, email and password (plain)
Expand Down

0 comments on commit 90ba133

Please sign in to comment.