Sha256: 8cd66265d32554516cb545bb641ad0ec07d1cab8c5d1f972050864979078f215
Contents?: true
Size: 1.1 KB
Versions: 2
Compression:
Stored size: 1.1 KB
Contents
require 'omniauth-oauth2' module OmniAuth module Strategies class FigmaOauth2 < OmniAuth::Strategies::OAuth2 option :name, 'figma_oauth2' option :scope, 'file_read' option :client_options, { site: 'https://www.figma.com', authorize_url: '/oauth', token_url: '/api/oauth/token' } option :token_options, [:client_id, :client_secret] option :token_params, { parse: :json } uid { raw_info['id'].to_s } info do { :name => raw_info['handle'], :email => raw_info['email'], :image => raw_info['img_url'] } end credentials do { :access_token => access_token.token, :expires_at => access_token.expires_at, :expires => access_token.expires?, :refresh_token => access_token.refresh_token } end def raw_info @raw_info = access_token.get('https://api.figma.com/v1/me').parsed end def callback_url full_host + script_name + callback_path end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
omniauth-figma-oauth2-0.2.0 | lib/omniauth/strategies/figma_oauth2.rb |
omniauth-figma-oauth2-0.1.0 | lib/omniauth/strategies/figma.rb |