From 35d718d3406c19a39c738ac192fa8a6984cfd6b7 Mon Sep 17 00:00:00 2001 From: skoh-fley Date: Fri, 8 Nov 2013 10:54:14 -0800 Subject: [PATCH] Twitch login now sets password confirmation --- app/controllers/user_sessions_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/user_sessions_controller.rb b/app/controllers/user_sessions_controller.rb index cd3bce1..4b118f4 100644 --- a/app/controllers/user_sessions_controller.rb +++ b/app/controllers/user_sessions_controller.rb @@ -48,7 +48,9 @@ class UserSessionsController < ApplicationController user.email = user_resp['email'] user.oauth_token = token o = [('a'..'z'), ('A'..'Z')].map { |i| i.to_a }.flatten - user.password = (0...50).map{ o[rand(o.length)] }.join + random_string = (0...50).map{ o[rand(o.length)] }.join + user.password = random_string + user.password_confirmation = random_string if user.save current_session = UserSession.create(user, remember_me: true) redirect_to root_path, notice: 'Logged in!' -- knotmirror 0.0.1