cz_auth 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  FactoryGirl.define do
2
2
 
3
3
  factory :user do
4
- sequence(:email) { |n| "test_#{n}@bqsoft.com" }
4
+ sequence(:email) { |n| "test_#{n}@example.com" }
5
5
  password 'p@ssw0rd'
6
6
  password_confirmation 'p@ssw0rd'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cz_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Kelley
@@ -46,10 +46,11 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - app/controllers/cz_auth/application_controller.rb
49
- - app/controllers/cz_auth/authentication_controller.rb
50
49
  - app/controllers/cz_auth/concerns/authentication.rb
51
- - app/views/cz_auth/authentication/create.json.erb
52
- - app/views/cz_auth/authentication/invalid.json
50
+ - app/controllers/cz_auth/sessions_controller.rb
51
+ - app/views/cz_auth/sessions/create.json.erb
52
+ - app/views/cz_auth/sessions/invalid.json
53
+ - app/views/cz_auth/sessions/new.html.erb
53
54
  - config/environment.rb
54
55
  - config/routes.rb
55
56
  - lib/cz_auth/engine.rb
@@ -1,26 +0,0 @@
1
- module CzAuth
2
- class AuthenticationController < ApplicationController
3
- skip_before_filter { :"authorize_#{model}!" }
4
-
5
- def create
6
- resource = model.where(email: params[:email]).first
7
- @authenticated = perform_authentication_for(resource || model)
8
- render @authenticated ? 'create' : 'invalid'
9
- end
10
-
11
- def destroy
12
- delete_session_cookie
13
- end
14
-
15
- private
16
-
17
- def resource_param
18
- "#{params[:resource]}".classify
19
- end
20
-
21
- def model
22
- resource = "#{resource_param}".constantize
23
- end
24
-
25
- end
26
- end