rails_cerberus 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ec9ebc2b0b15ab9162c41b48d1362329ee87356
4
- data.tar.gz: 2319001da788f897595fcecffbbb5686bc6e0201
3
+ metadata.gz: 41fcf03db53b27aefcfe06031039fe33fc940f38
4
+ data.tar.gz: c4d6335258e37541de4e6f7e7bfd2fd36d5ca67d
5
5
  SHA512:
6
- metadata.gz: 31ec585915f081d467c849ad8dcfe9044314be5b3790baef87e309ec6e3c3b438f68b1eb5a463285e36292fdaaf879d58058d7006164396893fa5c633f088c62
7
- data.tar.gz: 3bd83c1a6d79350bef98fafc61e46cee0703108ee28e241202eaf9ccbc757a35e00cc9618ed260c4184b6b128d72d557f2bdbcc19310537381c086a8d9293d11
6
+ metadata.gz: 5d6218cc662e5113b50303ecfbad76dc3a338f2f606c7d22af54af109fd4a9c685877a760727a3a0bdb583d936d68639e9bcaada1cd4d2035c94b058b294776f
7
+ data.tar.gz: 88b46440532878bc5504f29d0ccd0b7c151cea01e156519c911e49dafc6bfce4318547791d81a0b9cfcd4581f661a1c450d48c31b613e084a2b6467e5b7792cd
@@ -2,7 +2,7 @@ require 'cerberus/identity'
2
2
 
3
3
  class Cerberus::SessionsController < ActionController::Base
4
4
  def create
5
- identity = Cerberus::Identity.find_or_create_by! auth.slice(:provider, :uid)
5
+ identity = Cerberus::Identity.find_or_create_by! identity_params
6
6
  identity.user ||= Cerberus.config[:identities][:user_class_name].constantize.find_or_create_by! email: auth[:info][:email]
7
7
  identity.save
8
8
 
@@ -18,4 +18,7 @@ class Cerberus::SessionsController < ActionController::Base
18
18
  private
19
19
 
20
20
  def auth() env['omniauth.auth'] end
21
+ def auth_params() @auth_params ||= ActionController::Parameters.new(auth) end
22
+ def identity_params() auth_params.permit(:provider, :uid) end
23
+ def user_params() auth_params.permit(info: [:email]) end
21
24
  end
@@ -1,3 +1,3 @@
1
1
  module Cerberus
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_cerberus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Oga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-27 00:00:00.000000000 Z
11
+ date: 2014-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails