auth

Paddy 2015-07-18 Parent:0a2c3d677161 Child:b7e685839a1b

179:7bba108d2d9a Go to Latest

auth/profile.go

Send events when logins are verified. Add an ActionLoginVerified constant to use as the action when a login has been verified. On second thought, this should probably just be "verified", huh? Then we can reuse it across models. Oops. We also added a call to send a login verified event to NSQ when the login is verified.

History
     1.1 --- a/profile.go	Wed Jul 15 00:13:59 2015 -0400
     1.2 +++ b/profile.go	Sat Jul 18 03:36:13 2015 -0400
     1.3 @@ -29,6 +29,7 @@
     1.4  
     1.5  	// ActionResendVerification is the action property of the event sent when the user wants to resend their login verification code.
     1.6  	ActionResendVerification = "resend_verification"
     1.7 +	ActionLoginVerified      = "login_verified"
     1.8  )
     1.9  
    1.10  var (
    1.11 @@ -899,6 +900,7 @@
    1.12  			encode(w, r, http.StatusInternalServerError, actOfGodResponse)
    1.13  			return
    1.14  		}
    1.15 +		go context.SendModelEvent(login, ActionLoginVerified)
    1.16  		login.Verified = true
    1.17  	} else if req.ResendVerification != nil {
    1.18  		if !*req.ResendVerification {