Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

omniauth-voupe

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omniauth-voupe

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Omniauth Voupe

Add the omniauth-voupe gem to your Gemfile and configure as follows:

# config/initializers/omniauth.rb

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :voupe, "ID", "SECRET"
end
# app/controllers/sessions_controller.rb

class SessionsController < ApplicationController
  def index
    redirect_to "/auth/voupe"
  end

  def new
    redirect_to "/auth/voupe"
  end

  def create
    @user = User.find_or_create_from_auth_hash(request.env['omniauth.auth'])
    session[:user_id] = @user.id
    redirect_to root_path
  end
end
# config/routes.rb

get "/auth/voupe/callback", to: "sessions#create"
# app/models/user.rb

def self.find_or_create_from_auth_hash(auth_hash)
  user = where(voupe_portal_token: auth_hash.uid).first_or_create
  user.update(
    email: auth_hash.info.email,
    first_name: auth_hash.info.first_name,
    last_name: auth_hash.info.last_name
  )
  user
end

FAQs

Package last updated on 23 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc