app/controllers/sessions_controller.rb
7aef87db
 class SessionsController < ApplicationController
 	def new
 
 	end
 
 	def create
531ecd5f
 		require_dependency "signin.rb"
7aef87db
 
531ecd5f
 		begin
 			Signin.try_login(params[:jid].downcase, params[:password])
 		rescue Signin::LoginError
 			flash.now[:error] = I18n.t 'login.error'
 			return render 'new'
 		end
 
1b9ff864
         create_new_authentication(params[:jid].downcase)
ff94bdbf
         redirect_to chat_template_path, flash: {notice: I18n.t('login.success')}
7aef87db
 	end
 
 	def destroy
 		self.remove_old_session(session[:token])
 	end
 end