nyauth 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +1 -0
- data/Rakefile +26 -0
- data/app/assets/javascripts/nyauth/application.js +13 -0
- data/app/assets/stylesheets/nyauth/application.css +15 -0
- data/app/controllers/concerns/nyauth/session_concern.rb +71 -0
- data/app/controllers/nyauth/confirmation_requests_controller.rb +28 -0
- data/app/controllers/nyauth/confirmations_controller.rb +19 -0
- data/app/controllers/nyauth/new_password_requests_controller.rb +28 -0
- data/app/controllers/nyauth/new_passwords_controller.rb +26 -0
- data/app/controllers/nyauth/passwords_controller.rb +26 -0
- data/app/controllers/nyauth/registrations_controller.rb +26 -0
- data/app/controllers/nyauth/sessions_controller.rb +31 -0
- data/app/helpers/nyauth/application_helper.rb +4 -0
- data/app/mailers/nyauth/user_mailer.rb +15 -0
- data/app/models/concerns/nyauth/authenticatable.rb +18 -0
- data/app/models/concerns/nyauth/confirmable.rb +34 -0
- data/app/models/concerns/nyauth/new_password_ability.rb +35 -0
- data/app/models/concerns/nyauth/password_digest_ability.rb +40 -0
- data/app/responders/nyauth/app_responder.rb +6 -0
- data/app/responders/nyauth/confirmation_responder.rb +14 -0
- data/app/services/nyauth/confirmation_request_service.rb +15 -0
- data/app/services/nyauth/session_service.rb +21 -0
- data/app/views/layouts/nyauth/mailer.html.erb +1 -0
- data/app/views/layouts/nyauth/mailer.text.erb +1 -0
- data/app/views/nyauth/confirmation_requests/new.html.slim +5 -0
- data/app/views/nyauth/confirmations/edit.html.slim +5 -0
- data/app/views/nyauth/group_requests/edit.html.slim +0 -0
- data/app/views/nyauth/group_requests/new.html.slim +14 -0
- data/app/views/nyauth/groups/show.html.slim +0 -0
- data/app/views/nyauth/layouts/application.html.slim +15 -0
- data/app/views/nyauth/layouts/mailer.html.slim +1 -0
- data/app/views/nyauth/layouts/mailer.text.slim +1 -0
- data/app/views/nyauth/new_password_requests/new.html.slim +5 -0
- data/app/views/nyauth/new_passwords/edit.html.slim +11 -0
- data/app/views/nyauth/passwords/edit.html.slim +11 -0
- data/app/views/nyauth/registrations/new.html.slim +12 -0
- data/app/views/nyauth/sessions/new.html.slim +15 -0
- data/app/views/nyauth/user_mailer/request_confirmation.html.slim +2 -0
- data/app/views/nyauth/user_mailer/request_confirmation.text.erb +3 -0
- data/app/views/nyauth/user_mailer/request_new_password.html.slim +2 -0
- data/app/views/nyauth/user_mailer/request_new_password.text.erb +3 -0
- data/config/application.yml +1 -0
- data/config/locales/en.yml +46 -0
- data/config/routes.rb +10 -0
- data/lib/nyauth/encryptor.rb +26 -0
- data/lib/nyauth/engine.rb +21 -0
- data/lib/nyauth/version.rb +3 -0
- data/lib/nyauth.rb +5 -0
- data/lib/tasks/nyauth_tasks.rake +4 -0
- data/spec/controllers/application_controller_spec.rb +5 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +7 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/user.rb +5 -0
- data/spec/dummy/app/views/layouts/application.html.erb +20 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config/application.rb +32 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +42 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +46 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20150303135922_create_users.rb +18 -0
- data/spec/dummy/db/schema.rb +32 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1906 -0
- data/spec/dummy/log/test.log +6719 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/users.rb +21 -0
- data/spec/featrues/nyauth/confirmation_requests_spec.rb +35 -0
- data/spec/featrues/nyauth/new_password_requests_spec.rb +43 -0
- data/spec/featrues/nyauth/passwords_spec.rb +27 -0
- data/spec/featrues/nyauth/registrations_spec.rb +24 -0
- data/spec/featrues/nyauth/sessions_spec.rb +36 -0
- data/spec/models/user_spec.rb +9 -0
- data/spec/rails_helper.rb +41 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/support/controllers/nyauth/session_concern.rb +39 -0
- data/spec/support/macros/controller_macros.rb +3 -0
- data/spec/support/macros/feature_macros.rb +8 -0
- data/spec/support/models/nyauth/authenticatable.rb +36 -0
- data/spec/support/models/nyauth/confirmable.rb +27 -0
- data/spec/support/models/nyauth/new_password_ability.rb +13 -0
- data/spec/support/models/nyauth/password_digest_ability.rb +18 -0
- metadata +280 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: 8a22167098dd38d399b57de449d2209af30e1983e4084893c03bd986505346a85d8e8e6541e8e7d6017932af86415c0e6c5fffd3b54b1ab5c177588852b62f44
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 3f2b2cefdb77a3a977a563857dacb4eb7aa5c1948c66c29d33d80630f2e8a886e2932066f49dfb0c95a5ebe5376469421be5158b25b7ed35f6bb5bfe628153db
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :users do |t|
|
4
|
+
t.string :email, null: false
|
5
|
+
t.string :password_digest, null: false
|
6
|
+
t.string :password_salt, null: false
|
7
|
+
t.string :nickname
|
8
|
+
t.datetime :confirmed_at
|
9
|
+
t.string :confirmation_key
|
10
|
+
t.datetime :confirmation_key_expired_at
|
11
|
+
t.string :new_password_key
|
12
|
+
t.datetime :new_password_key_expired_at
|
13
|
+
|
14
|
+
t.timestamps null: false
|
15
|
+
end
|
16
|
+
add_index :users, :email, unique: true
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 20150303135922) do
|
15
|
+
|
16
|
+
create_table "users", force: :cascade do |t|
|
17
|
+
t.string "email", null: false
|
18
|
+
t.string "password_digest", null: false
|
19
|
+
t.string "password_salt", null: false
|
20
|
+
t.string "nickname"
|
21
|
+
t.datetime "confirmed_at"
|
22
|
+
t.string "confirmation_key"
|
23
|
+
t.datetime "confirmation_key_expired_at"
|
24
|
+
t.string "new_password_key"
|
25
|
+
t.datetime "new_password_key_expired_at"
|
26
|
+
t.datetime "created_at", null: false
|
27
|
+
t.datetime "updated_at", null: false
|
28
|
+
end
|
29
|
+
|
30
|
+
add_index "users", ["email"], name: "index_users_on_email", unique: true
|
31
|
+
|
32
|
+
end
|
Binary file
|