nyauth 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43f12311bbcbae2757a70708c8729fcd541af09c
4
- data.tar.gz: 8911316b67a0cabca61b72a25a0a0e25264fb3f5
3
+ metadata.gz: fa665b789065b1cb2ce9a772c824d6f2d03c158a
4
+ data.tar.gz: e6fc77b3c1d8804ee127efb05b2c62f7ad898b43
5
5
  SHA512:
6
- metadata.gz: 5bbb2a9bc1b43dd74198adaca2a241f06d1ae5db25b3753dd9694b1dff49278568a253e9c7beec302fb9819c99d7befd17aaed796b1dd7ab4c233c3343b5cdf0
7
- data.tar.gz: a0434f772ab0f52520dadb3af244ef556ef3904f9e589ec472b10ba8b7f30b887a67c978123f77f16453917161e72261242302ee35b1eb57a565098c2917044e
6
+ metadata.gz: de301bc13261d9feae6f717b4787de4aac4840ccc2fb48b4853c592c014b34516d35add7db2dd6a9fd013ae62886fb8759cecb14148a10c7825ab4d398cbee34
7
+ data.tar.gz: 551c3947db51fdc8e5761711654f9c61c053fb0d4be9080f825e8923a861d74c6ef8aa08a1fb827acf03a08c30a011985b9e6d564a48c162f49d64b30f02fd01
data/README.md CHANGED
@@ -1 +1,71 @@
1
1
  # Nyauth
2
+
3
+ ```application_controller
4
+ class ApplicationController < ActionController::Base
5
+ include Nyauth::SessionConcern
6
+ self.responder = Nyauth::AppResponder
7
+ end
8
+ ```
9
+
10
+ ```schema
11
+ class CreateUsers < ActiveRecord::Migration
12
+ def change
13
+ create_table :users do |t|
14
+ t.string :email, null: false
15
+ t.string :password_digest, null: false
16
+ t.string :password_salt, null: false
17
+ t.string :nickname
18
+ t.datetime :confirmed_at
19
+ t.string :confirmation_key
20
+ t.datetime :confirmation_key_expired_at
21
+ t.string :new_password_key
22
+ t.datetime :new_password_key_expired_at
23
+
24
+ t.timestamps null: false
25
+ end
26
+ add_index :users, :email, unique: true
27
+ end
28
+ end
29
+ ```
30
+
31
+ ```model
32
+ class User < ActiveRecord::Base
33
+ include Nyauth::Authenticatable
34
+ include Nyauth::Confirmable
35
+ include Nyauth::NewPasswordAbility
36
+ end
37
+ ```
38
+
39
+ ```routes
40
+ Rails.application.routes.draw do
41
+ mount Nyauth::Engine => "/"
42
+ end
43
+ ```
44
+
45
+ ```
46
+ rake routes
47
+ ```
48
+
49
+ ```
50
+ Prefix Verb URI Pattern Controller#Action
51
+ nyauth /nyauth Nyauth::Engine
52
+
53
+ Routes for Nyauth::Engine:
54
+ registration POST /registration(.:format) nyauth/registrations#create
55
+ new_registration GET /registration/new(.:format) nyauth/registrations#new
56
+ session POST /session(.:format) nyauth/sessions#create
57
+ new_session GET /session/new(.:format) nyauth/sessions#new
58
+ DELETE /session(.:format) nyauth/sessions#destroy
59
+ edit_password GET /password/edit(.:format) nyauth/passwords#edit
60
+ password PATCH /password(.:format) nyauth/passwords#update
61
+ PUT /password(.:format) nyauth/passwords#update
62
+ confirmation_requests POST /confirmation_requests(.:format) nyauth/confirmation_requests#create
63
+ new_confirmation_request GET /confirmation_requests/new(.:format) nyauth/confirmation_requests#new
64
+ confirmation GET /confirmations/:confirmation_key(.:format) nyauth/confirmations#update
65
+ new_password_requests POST /new_password_requests(.:format) nyauth/new_password_requests#create
66
+ new_new_password_request GET /new_password_requests/new(.:format) nyauth/new_password_requests#new
67
+ edit_new_password GET /new_passwords/:new_password_key/edit(.:format) nyauth/new_passwords#edit
68
+ new_password PATCH /new_passwords/:new_password_key(.:format) nyauth/new_passwords#update
69
+ PUT /new_passwords/:new_password_key(.:format) nyauth/new_passwords#update
70
+ root GET / nyauth/sessions#new
71
+ ```
@@ -0,0 +1,5 @@
1
+ module Nyauth
2
+ class BaseController < ApplicationController
3
+ helper Nyauth::ApplicationHelper
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Nyauth
2
- class ConfirmationRequestsController < ApplicationController
2
+ class ConfirmationRequestsController < Nyauth::BaseController
3
3
  allow_everyone
4
4
  respond_to :html, :json
5
5
  before_action :set_user, only: [:create]
@@ -1,5 +1,5 @@
1
1
  module Nyauth
2
- class ConfirmationsController < ApplicationController
2
+ class ConfirmationsController < Nyauth::BaseController
3
3
  allow_everyone
4
4
  self.responder = ConfirmationResponder
5
5
  respond_to :html, :json
@@ -1,5 +1,5 @@
1
1
  module Nyauth
2
- class NewPasswordRequestsController < ApplicationController
2
+ class NewPasswordRequestsController < Nyauth::BaseController
3
3
  allow_everyone
4
4
  respond_to :html, :json
5
5
  before_action :set_user, only: [:create]
@@ -1,5 +1,5 @@
1
1
  module Nyauth
2
- class NewPasswordsController < ApplicationController
2
+ class NewPasswordsController < Nyauth::BaseController
3
3
  allow_everyone
4
4
  respond_to :html, :json
5
5
  before_action :set_user
@@ -1,5 +1,5 @@
1
1
  module Nyauth
2
- class PasswordsController < ApplicationController
2
+ class PasswordsController < Nyauth::BaseController
3
3
  respond_to :html, :json
4
4
  before_action :set_user
5
5
 
@@ -1,5 +1,5 @@
1
1
  module Nyauth
2
- class RegistrationsController < ApplicationController
2
+ class RegistrationsController < Nyauth::BaseController
3
3
  allow_everyone
4
4
  respond_to :html, :json
5
5
  before_action :set_user
@@ -1,5 +1,5 @@
1
1
  module Nyauth
2
- class SessionsController < ApplicationController
2
+ class SessionsController < Nyauth::BaseController
3
3
  allow_everyone only: [:new, :create]
4
4
  respond_to :html, :json
5
5
  before_action :set_session_service
@@ -1,4 +1,11 @@
1
1
  module Nyauth
2
2
  module ApplicationHelper
3
+ def method_missing method, *args, &block
4
+ if method =~ /(_url|_path)\z/
5
+ main_app.send(method, *args)
6
+ else
7
+ super
8
+ end
9
+ end
3
10
  end
4
11
  end
@@ -1,3 +1,3 @@
1
1
  module Nyauth
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
Binary file