コード例 #1
0
func (a AuthenticationController) EditUser(w http.ResponseWriter, r *http.Request) {
	user_details := new(models.User_input)
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&user_details)
	if err != nil {
		logging.Logger.Error("Unable to decode the json input at edit user details")
		panic(err)
	}
	responseStatus := services.EditUser(user_details, a.db_session)
	authentication_core.WriteResponse(w, responseStatus)
}
コード例 #2
0
func (a AuthenticationController) IsValidForgotPasswordToken(w http.ResponseWriter, r *http.Request) {
	forgot_pass_token := new(models.Forgot_password_token)
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&forgot_pass_token)
	if err != nil {
		logging.Logger.Error("Unable to decode the json input in checking for validity of forgot  password token")
		panic(err)
	}
	responseStatus := services.IsValidForgotPasswordToken(forgot_pass_token)
	authentication_core.WriteResponse(w, responseStatus)
}
コード例 #3
0
func (a AuthenticationController) ForgotPasswordChange(w http.ResponseWriter, r *http.Request) {
	forgot_pass_change_det := new(models.Forgot_password_change)
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&forgot_pass_change_det)
	if err != nil {
		logging.Logger.Error("Unable to decode the json input at forgot  password change")
		panic(err)
	}
	responseStatus := services.ForgotPasswordChange(forgot_pass_change_det, a.db_session)
	authentication_core.WriteResponse(w, responseStatus)
}
コード例 #4
0
func (a AuthenticationController) ChangePassword(w http.ResponseWriter, r *http.Request) {
	change_pass_det := new(models.Change_password)
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&change_pass_det)
	if err != nil {
		logging.Logger.Error("Unable to decode the json input at change password")
		panic(err)
	}
	responseStatus := services.ChangePassword(change_pass_det, a.db_session)
	authentication_core.WriteResponse(w, responseStatus)
}