app/controllers/contour/authentications_controller.rb in contour-1.2.0.pre vs app/controllers/contour/authentications_controller.rb in contour-1.2.0.pre2
- old
+ new
@@ -28,10 +28,11 @@
redirect_to authentications_path, notice: "Authentication successful."
else
logger.info "Creating new user with new authentication."
user = User.new(params[:user])
user.apply_omniauth(omniauth)
+ user.password = Devise.friendly_token[0,20] if user.password.blank?
if user.save
session["user_return_to"] = request.env["action_dispatch.request.unsigned_session_cookie"]["user_return_to"] if request.env and request.env["action_dispatch.request.unsigned_session_cookie"] and request.env["action_dispatch.request.unsigned_session_cookie"]["user_return_to"] and session["user_return_to"].blank?
flash[:notice] = "Signed in successfully." if user.active_for_authentication?
sign_in_and_redirect(:user, user)
else
@@ -48,6 +49,6 @@
@authentication = current_user.authentications.find(params[:id])
@authentication.destroy
flash[:notice] = "Successfully destroyed authentication."
redirect_to authentications_path
end
-end
\ No newline at end of file
+end