lobby 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@ module Lobby
27
27
 
28
28
  def destroy
29
29
  session[:user_id] = nil
30
- redirect_to root_url, flash: {success: t( '.success' ) }
30
+ redirect_to main_app.root_url, flash: {success: t( '.success' ) }
31
31
  end
32
32
  end
33
33
  end
@@ -0,0 +1,33 @@
1
+ module Lobby
2
+ class SessionsController < ApplicationController
3
+ def new
4
+ end
5
+
6
+ def create
7
+ @user = User.where('email = ? OR username = ?', params[:email], params[:email]).first
8
+ if @user && @user.authenticate(params[:password])
9
+ if @user.confirmed?
10
+ if @user.active?
11
+ session[:user_id] = @user.id
12
+ flash.now[:success] = t( '.flash.success' )
13
+ redirect_to root_url
14
+ else
15
+ flash.now[:danger] = t( '.flash.error.not_active' )
16
+ redirect_to log_in_url
17
+ end
18
+ else
19
+ flash.now[:danger] = t( '.flash.error.not_confirmed' )
20
+ redirect_to confirm_url( :action => "registration" )
21
+ end
22
+ else
23
+ flash.now[:danger] = t( '.flash.error.wrong_password_or_email' )
24
+ render :new
25
+ end
26
+ end
27
+
28
+ def destroy
29
+ session[:user_id] = nil
30
+ redirect_to root_url, flash: {success: t( '.success' ) }
31
+ end
32
+ end
33
+ end
data/lib/lobby/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lobby
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Lobby
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lobby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -233,6 +233,7 @@ files:
233
233
  - app/assets/javascripts/lobby/application.js
234
234
  - app/controllers/lobby/application_controller.rb
235
235
  - app/controllers/lobby/confirmation_controller.rb
236
+ - app/controllers/lobby/sessions_controller.rb~
236
237
  - app/controllers/lobby/users_controller.rb
237
238
  - app/controllers/lobby/sessions_controller.rb
238
239
  - app/controllers/lobby/application_controller.rb~