This gem require OmniAuth
But you no need add gem 'omniauth'
.
This gem already added.
gem "omniauth-tinkoff-id"
Join to TinkoffId
-
Add to omniauth.rb tinkoff_id provider:
Rails.application.config.middleware.use OmniAuth::Builder do provider :tinkoff_id, ENV['TINKOFF_CLIENT_ID'], ENV['TINKOFF_CLIENT_SECRET'] end
-
Add route
get '/auth/:provider/callback', to: 'sessions#create'
-
Create SessionController
class SessionsController < ApplicationController
def create
@user = User.find_or_create_from_auth_hash(auth_hash)
redirect_to '/'
end
protected
def auth_hash
request.env['omniauth.auth']
end
end
- Fork it (https://github.com/foxford/omniauth-tinkoff-id/fork)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Yury Druzhkov - Initial work
See also the list of contributors who participated in this project.
This project is licensed under the MIT License.