Project

vxod

0.0
No commit activity in last 3 years
No release in over 3 years
Social and password authorization solution
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Project Readme

Vxod

Social and password authorization solution

Build Status Code Climate Dependency Status Gem Version

Login

Features

  • openid registration/login
  • require email in openid registration
  • password base registration/login
  • checkbox auto-generate password and send to email
  • reset password

Future

  • profile with password reset, link other openid servises to user
  • adminka for user management
  • support Sinatra, Mongoid, Rails, ActiveRecord, any Rack app, any DB

Setup

Gemfile

  gem 'omniauth'
  gem 'omniauth-twitter'
  gem 'omniauth-vkontakte'
  gem 'omniauth-facebook'
  gem 'omniauth-google-oauth2'
  gem 'omniauth-github'
  gem 'vxod'

app.rb

  enable :sessions
  set :sessions, secret: ENV['secret_secret']

  use OmniAuth::Builder do
    provider :twitter, ENV['omniauth.twitter'], ENV['omniauth.twitter_x']
    provider :vkontakte, ENV['omniauth.vkontakte'], ENV['omniauth.vkontakte_x']
    provider :facebook, ENV['omniauth.facebook'], ENV['omniauth.facebook_x']
    provider :google_oauth2, ENV['omniauth.google'], ENV['omniauth.google_x']
    provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET']
  end

  use Vxod::Middleware

  # render middware html in app layout
  %w(get post).each do |method|
    app.send(method, '*') do
      if env['VXOD.HTML']
        slim :vxod_layout, locals: { html: env['VXOD.HTML'] }
      else
        pass
      end
    end
  end

config/smtp.rb

Pony.options = {
  from: '???',
  via: :smtp,
  via_options: {
    address:      'smtp.yandex.ru',
    port:         '587',
    smtp_domain:  '???',
    user_name:    '???',
    password:     '???',

    enable_starttls_auto: true,
    authentication: :plain, # :plain, :login, :cram_md5, no auth by default
  }
}

helpers.rb

helpers do
  def vxod
    @vxod ||= Vxod.api(self)
  end
end

Usage

p = vxod.user.email get current user

Contributing

  1. Fork it ( http://github.com/SergXIIIth/vxod/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request