teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

誤字

2018/10/17 05:44

投稿

t_54342134142
t_54342134142

スコア11

title CHANGED
File without changes
body CHANGED
@@ -33,4 +33,20 @@
33
33
  get 'pages/show'
34
34
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
35
35
  end
36
+ ```
37
+
38
+
39
+ ```
40
+ omniauth_callbacks_controller.rb
41
+
42
+ def twitter
43
+ @user = User.from_omniauth(request.env["omniauth.auth"].except("extra"))
44
+
45
+ if @user.persisted?
46
+ sign_in_and_redirect @user
47
+ else
48
+ session["devise.user_attributes"] = @user.attributes
49
+ redirect_to new_user_registration_url
50
+ end
51
+ end
36
52
  ```