Fix omniauth GitHub scope to include user email access

This commit is contained in:
Eugene Burmakin 2025-10-26 15:32:26 +01:00
parent f5dc7a10a3
commit 44bbbd09b7
4 changed files with 6 additions and 7 deletions

View file

@ -152,7 +152,6 @@ class User < ApplicationRecord # rubocop:disable Metrics/ClassLength
return user if user return user if user
binding.pry
User.create( User.create(
email: data['email'], email: data['email'],
password: Devise.friendly_token[0, 20] password: Devise.friendly_token[0, 20]

View file

@ -62,10 +62,10 @@
<div class="form-control mt-6"> <div class="form-control mt-6">
<%= f.submit "Update", class: 'btn btn-primary' %> <%= f.submit "Update", class: 'btn btn-primary' %>
</div> </div>
<%= render "devise/shared/links" %>
<% end %> <% end %>
<%= render "devise/shared/links" %>
<p class='mt-3'>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { turbo_confirm: "Are you sure?", turbo_method: :delete }, method: :delete, class: 'btn' %></p> <p class='mt-3'>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), data: { turbo_confirm: "Are you sure?", turbo_method: :delete }, method: :delete, class: 'btn' %></p>
<div class="divider"></div> <div class="divider"></div>
<p class='mt-3 flex flex-col gap-2'> <p class='mt-3 flex flex-col gap-2'>

View file

@ -63,10 +63,10 @@
<%= f.submit (@invitation ? "Create Account & Join Family" : "Sign up"), <%= f.submit (@invitation ? "Create Account & Join Family" : "Sign up"),
class: 'btn btn-primary' %> class: 'btn btn-primary' %>
</div> </div>
<% end %>
<% unless @invitation %> <% unless @invitation %>
<%= render "devise/shared/links" %> <%= render "devise/shared/links" %>
<% end %>
<% end %> <% end %>
</div> </div>
</div> </div>

View file

@ -265,7 +265,7 @@ Devise.setup do |config|
# ==> OmniAuth # ==> OmniAuth
# Add a new OmniAuth provider. Check the wiki for more information on setting # Add a new OmniAuth provider. Check the wiki for more information on setting
# up on your models and hooks. # up on your models and hooks.
config.omniauth :github, ENV['GITHUB_OAUTH_CLIENT_ID'], ENV['GITHUB_OAUTH_CLIENT_SECRET'], scope: 'user' config.omniauth :github, ENV['GITHUB_OAUTH_CLIENT_ID'], ENV['GITHUB_OAUTH_CLIENT_SECRET'], scope: 'user:email'
# ==> Warden configuration # ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or # If you want to use other strategies, that are not supported by Devise, or