Skip to content

How to get it working in 2024Β #80

@initseis

Description

@initseis

I had to do Monkey Patching like this:

module OmniAuth
  module Strategies
    class LinkedIn < OmniAuth::Strategies::OAuth2
      uid do
        raw_info["sub"]
      end

      info do
        {
          :name => raw_info["given_name"],
          :family_name => raw_info["family_name"],
          :email => raw_info["email"],
          :image => raw_info["picture"]
        }
      end

      extra do
        {
          "info" => raw_info
        }
      end

      def profile_endpoint
        "/v2/userinfo"
      end
    end
  end
end

And the button this way:

<%= button_to "/auth/linkedin", data: { turbo: false }, class: "px-4 py-2 border flex gap-2 border-dark rounded-lg text-dark hover:shadow transition duration-150"  do %>
  <span class="size-6">
    <%= render "icons/linkedin" %>
  </span>
  <span><%= t("pages.sign_up.sign_up_with_linkedin") %></span>
<% end %>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions