Merged branch RDB-Implement-Change-Password into Rapid-Dev-Branch

This commit is contained in:
Okechi Onyeje 2016-08-29 20:22:13 -04:00
commit 8b17acc3d3
3 changed files with 43 additions and 9 deletions

View File

@ -230,7 +230,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift"
timestampString = "494088391.775639"
timestampString = "494209191.241024"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "460"
@ -245,7 +245,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift"
timestampString = "494088391.776282"
timestampString = "494209191.241192"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "460"
@ -278,7 +278,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift"
timestampString = "494088391.778069"
timestampString = "494209191.241994"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "479"
@ -293,7 +293,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift"
timestampString = "494088391.778442"
timestampString = "494209191.242121"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "481"
@ -342,7 +342,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift"
timestampString = "494088391.780562"
timestampString = "494209191.243433"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "498"
@ -357,7 +357,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift"
timestampString = "494088391.780713"
timestampString = "494209191.243578"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "498"
@ -372,7 +372,7 @@
moduleName = "Vendoo"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/okechi/Documents/iOs%20Practice/Vendoo/Vendoo_bb/Vendoo/Vendoo/ListingPreviewViewController.swift"
timestampString = "494088391.780851"
timestampString = "494209191.24367"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "500"
@ -678,5 +678,21 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Vendoo/SignInViewController.swift"
timestampString = "494208703.800413"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "65"
endingLineNumber = "65"
landmarkName = "signInUser(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -8,6 +8,7 @@
import UIKit
import Locksmith
import FirebaseAuth
class SettingsViewController: UIViewController {
@ -106,7 +107,7 @@ extension SettingsViewController: UITableViewDelegate {
//put in password changing code later
print("password accepted please enter new password")
let alert2 = UIAlertController(title: "Change Password", message: "WARNING! You are about to change your vendoo account password. Please enter your current password to continue.", preferredStyle: .Alert)
let alert2 = UIAlertController(title: "Change Password", message: "WARNING! You are about to change your vendoo account password. Please enter your new password to continue.", preferredStyle: .Alert)
alert2.addTextFieldWithConfigurationHandler({ (textField : UITextField!) -> Void in
@ -117,7 +118,24 @@ extension SettingsViewController: UITableViewDelegate {
alert2.addAction(UIAlertAction(title: "Change Password", style: .Default, handler:{(action: UIAlertAction!) in
let textField2 = alert2.textFields![0] as UITextField
print("your new password is \(textField2.text!). This will be take out once password change logic is implemented.")
FIRAuth.auth()?.currentUser?.updatePassword(textField2.text!, completion: {
(error) -> Void in
if (error != nil) {
print(error)
}else {
print("Current user's new password is now \(textField2.text!).")
do{
try Locksmith.updateData(["pass": textField2.text!], forUserAccount: (NSUserDefaults.standardUserDefaults().objectForKey("email") as? String)!, inService: "vendoo")
print("account credentials saved")
}
catch{
//could not save data to keychain
print("account credentials could not be saved")
}
}
})
}))
alert.dismissViewControllerAnimated(false, completion: {})