diff --git a/.gitignore b/.gitignore index 85cedcc..dd41cf8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.env /coverage /.bundle /log/* diff --git a/Gemfile b/Gemfile index 4898a53..381e018 100644 --- a/Gemfile +++ b/Gemfile @@ -12,6 +12,7 @@ gem 'devise' gem 'font-awesome-rails' gem 'jbuilder', '~> 2.5' gem 'jquery-rails' +gem 'omniauth-vkontakte' gem 'pg', '~> 0.18' gem 'public_activity' gem 'puma', '~> 3.0' @@ -29,6 +30,7 @@ end group :development, :test do gem 'byebug', platform: :mri + gem 'dotenv-rails' gem 'factory_girl_rails' gem 'rails-controller-testing' gem 'rspec-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 7691e65..a12b393 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -89,6 +89,10 @@ GEM warden (~> 1.2.3) diff-lcs (1.3) docile (1.1.5) + dotenv (2.2.0) + dotenv-rails (2.2.0) + dotenv (= 2.2.0) + railties (>= 3.2, < 5.1) equalizer (0.0.11) erubis (2.7.0) execjs (2.7.0) @@ -99,6 +103,8 @@ GEM railties (>= 3.0.0) faker (1.7.2) i18n (~> 0.5) + faraday (0.10.1) + multipart-post (>= 1.2, < 3) ffi (1.9.17) font-awesome-rails (4.7.0.1) railties (>= 3.2, < 5.1) @@ -119,6 +125,7 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) + hashie (3.5.5) i18n (0.7.0) ice_nine (0.11.2) jbuilder (2.6.1) @@ -129,6 +136,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.0.3) + jwt (1.5.6) launchy (2.4.3) addressable (~> 2.3) listen (3.0.8) @@ -146,6 +154,8 @@ GEM mini_portile2 (2.1.0) minitest (5.10.1) multi_json (1.12.1) + multi_xml (0.6.0) + multipart-post (2.0.0) nenv (0.3.0) nio4r (1.2.1) nokogiri (1.7.0.1) @@ -153,6 +163,20 @@ GEM notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) + oauth2 (1.3.0) + faraday (>= 0.8, < 0.11) + jwt (~> 1.0) + multi_json (~> 1.3) + multi_xml (~> 0.5) + rack (>= 1.2, < 3) + omniauth (1.6.1) + hashie (>= 3.4.6, < 3.6.0) + rack (>= 1.6.2, < 3) + omniauth-oauth2 (1.4.0) + oauth2 (~> 1.0) + omniauth (~> 1.2) + omniauth-vkontakte (1.3.7) + omniauth-oauth2 (~> 1.1) orm_adapter (0.5.0) parser (2.3.3.1) ast (~> 2.2) @@ -323,6 +347,7 @@ DEPENDENCIES coffee-rails (~> 4.2) database_cleaner devise + dotenv-rails factory_girl_rails faker font-awesome-rails @@ -331,6 +356,7 @@ DEPENDENCIES jquery-rails launchy listen (~> 3.0.5) + omniauth-vkontakte pg (~> 0.18) public_activity puma (~> 3.0) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 1388f2b..78eee59 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -250,6 +250,8 @@ # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' + config.omniauth :vkontakte, ENV['VK_APP_ID'], ENV['VK_APP_SECRET'], + scope: 'email' # , info_fields: 'email,name' # ==> Warden configuration # If you want to use other strategies, that are not supported by Devise, or