token_authenticate_me 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68df94b4977fffbbe43218a1ef239d5cc90d5fa2
4
- data.tar.gz: e18bb8e5973efac0c36efc65e31c6fef06ae664a
3
+ metadata.gz: ab1f69037ef25abac0ffb29692fb344673d8d390
4
+ data.tar.gz: 1a8b7bd247a123c0c6c2ab56d0473cc9bdf3118e
5
5
  SHA512:
6
- metadata.gz: af9b9c0223e81a0c177e13639f6594db7b9c7d478006461ef26202481347d28c8bb43a63f9d5ccbeef24c90beb9ff152f37c0c2dcc5bd0118dc426633771b598
7
- data.tar.gz: ad09ee6a67cb0f700c3102f99377ea878b0b86321515907e32a229d5574196b754af367febffe36d7934fe79de19bb4ea760e8e693acb8f2506ac2439abf7337
6
+ metadata.gz: 212c64338401ef20c70bc4e232d3de75ccf081dbf91de65725245fbee6e5a9ddf65e412c1e6f8404ef5c62c1d72a18dc9ab53f223fb48f8606d8ff3964ef6c3d
7
+ data.tar.gz: 0825e8e45fc23ccaaf0eac9436aa870c11e83f3dd679497207588b0a31e5ba0266a396457a6aa0e227e35efeadc94f9e0119fe02c384d422309d40e50d08aa29
data/README.md CHANGED
@@ -19,7 +19,7 @@ Replace `<model>` with the class name used for users. This will create the neces
19
19
 
20
20
  Include TokenAuthenticateMe::TokenAuthentication into the application controller or any controllers that require authorization:
21
21
  ````rb
22
- require 'token_authenticate_me/token_authentication'
22
+ require 'token_authenticate_me/controllers/token_authenticateable'
23
23
 
24
24
  class ApplicationController < ActionController::Base
25
25
  force_ssl if Rails.env.production?
@@ -28,7 +28,7 @@ class ApplicationController < ActionController::Base
28
28
  # For APIs, you may want to use :null_session instead.
29
29
  protect_from_forgery with: :exception
30
30
 
31
- include TokenAuthenticateMe::TokenAuthentication
31
+ include TokenAuthenticateMe::Controllers::TokenAuthenticateable
32
32
 
33
33
  #...
34
34
  end
@@ -43,5 +43,6 @@ class Api::V1::UsersController < Api::BaseController
43
43
  end
44
44
  ````
45
45
 
46
- ### TODO:
47
- [ ] - Make it so any resource name can be used for authentication (initial thought is either specify the default or pass resource name in token string?).
46
+ #### TODO:
47
+ - [ ] Make it so any resource name can be used for authentication (initial thought is either specify the default or pass resource name in token string?).
48
+ - [ ] Allow users to specify the API namespace default.
@@ -1,6 +1,6 @@
1
1
  class TokenAuthenticateMeMailer < ActionMailer::Base
2
- SIGNUP_PATH = 'sign-up'
3
- RESET_PATH = 'reset-password/:token/'
2
+ SIGNUP_PATH = '/sign-up'
3
+ RESET_PATH = '/reset-password/:token/'
4
4
 
5
5
  def valid_user_reset_password_email(root_url, user)
6
6
  @root_url = root_url
@@ -29,6 +29,19 @@ namespace :api do
29
29
  id: TokenAuthenticateMe::UUID_REGEX
30
30
  }
31
31
  )
32
+ end
33
+ ROUTE
34
+ end
35
+
36
+ def create_users_controller
37
+ template 'users.rb', 'app/controllers/api/users_controller.rb'
38
+
39
+ # Inject /api/v1/users route into routes file
40
+ route <<-ROUTE
41
+ namespace :api do
42
+ namespace :v1 do
43
+ resources :users
44
+ end
32
45
  end
33
46
  ROUTE
34
47
  end
@@ -0,0 +1,8 @@
1
+ require 'token_authenticate_me/controllers/token_authenticateable'
2
+
3
+ class Api::V1::UsersController < ApplicationController
4
+ include ApiMe
5
+ include TokenAuthenticateMe::Controllers::TokenAuthenticateable
6
+
7
+ skip_before_action :authenticate, only: [:create]
8
+ end
@@ -6,6 +6,9 @@ module TokenAuthenticateMe
6
6
 
7
7
  invoke 'token_authenticate_me:models', params
8
8
  invoke 'token_authenticate_me:controllers', params
9
+ invoke 'api_me:policy', ['user', 'username', 'email', 'password', 'password_confirmation']
10
+ invoke 'api_me:filter', ['user']
11
+ invoke 'serializer', ['user', 'username', 'email', 'created_at', 'updated_at']
9
12
  end
10
13
  end
11
14
  end
@@ -1,3 +1,3 @@
1
1
  module TokenAuthenticateMe
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: token_authenticate_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Clopton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-18 00:00:00.000000000 Z
12
+ date: 2014-11-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -187,6 +187,7 @@ files:
187
187
  - lib/generators/token_authenticate_me/controllers/controllers_generator.rb
188
188
  - lib/generators/token_authenticate_me/controllers/templates/password_reset.rb
189
189
  - lib/generators/token_authenticate_me/controllers/templates/sessions.rb
190
+ - lib/generators/token_authenticate_me/controllers/templates/users.rb
190
191
  - lib/generators/token_authenticate_me/install/install_generator.rb
191
192
  - lib/generators/token_authenticate_me/models/models_generator.rb
192
193
  - lib/generators/token_authenticate_me/models/templates/authentication_migration.rb