· 6 years ago · Jun 21, 2019, 01:04 PM
1def trello
2 @user = User.from_omniauth(request.env['omniauth.auth'])
3
4 if @user.persisted?
5 @client = Trello::Client.new(
6 :consumer_key => Rails.application.credentials.trello[:key],
7 :consumer_secret => Rails.application.credentials.trello[:secret],
8 :oauth_token => params[:oauth_token],
9 :oauth_token_secret => params[:oauth_verifier]
10 )
11 @user.update(client: @client)
12 sign_in_and_redirect @user, event: :authentication
13 set_flash_message(:notice, :success, kind: 'Trello') if is_navigational_format?
14 end
15 end