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
 
b8116faf
 		create_new_authentification()
531ecd5f
 		flash.now[:notice] = I18n.t 'login.success'
 		render 'new'
7aef87db
 	end
 
 	def destroy
 		self.remove_old_session(session[:token])
 	end
 end