tok_access 1.1.2 → 1.1.3
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 +4 -4
- data/README.md +11 -1
- data/lib/tok_access/tok_authenticable.rb +8 -1
- data/lib/tok_access/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b48bcb4580a8a0b77c5a40be82f1e9f67ea2fa9e
|
4
|
+
data.tar.gz: 849f77844409568673ffaadd4dbedfce3576bac1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7807f15133d585df70b0a0cf20559fe9c8ee57e0b3eec659dc5a7cd99105b53b45381688e7549c2cc62d938b90ab1c3fa1c769c0318df3afe37d3c87a62825f2
|
7
|
+
data.tar.gz: 2a3d2c559cf35f108640c3f8264fe1982241397e80b44b10d02f9476eb4e29bd3f820ee0cc0b456f641a5e425cc61fee7f909ac2eac5512d14eb7c507bb8d6e7
|
data/README.md
CHANGED
@@ -119,12 +119,22 @@ TokAccess use bcrypt has_secure_password and has_secure_token methods to handle
|
|
119
119
|
|
120
120
|
```
|
121
121
|
|
122
|
+
#### If you need to generate a new tok without validating anything.
|
123
|
+
```ruby
|
124
|
+
# Previously created user.
|
125
|
+
user = User.find(1)
|
126
|
+
user.create_tok
|
127
|
+
token = user.get_token
|
128
|
+
device_token = user.get_device_token
|
129
|
+
|
130
|
+
```
|
131
|
+
|
122
132
|
|
123
133
|
## Installation
|
124
134
|
Add this line to your application's Gemfile:
|
125
135
|
|
126
136
|
```ruby
|
127
|
-
gem 'tok_access', '~> 1.1.
|
137
|
+
gem 'tok_access', '~> 1.1.3'
|
128
138
|
```
|
129
139
|
|
130
140
|
And then execute:
|
@@ -50,7 +50,7 @@ module TokAccess
|
|
50
50
|
nil
|
51
51
|
end
|
52
52
|
|
53
|
-
# If the object is associated to the tok given the method will return
|
53
|
+
# If the object is associated to the tok given, the method will return
|
54
54
|
# the object and the methods #get_tok and #get_device_tok will
|
55
55
|
# return the tokens. Otherwise return nil
|
56
56
|
def provide_access(tok)
|
@@ -63,6 +63,13 @@ module TokAccess
|
|
63
63
|
nil
|
64
64
|
end
|
65
65
|
|
66
|
+
# Create a new tok with a new token and a new device_token
|
67
|
+
# that can be access using the methods #get_token and #get_device_token.
|
68
|
+
def create_tok
|
69
|
+
generate_access_toks
|
70
|
+
return self
|
71
|
+
end
|
72
|
+
|
66
73
|
private
|
67
74
|
|
68
75
|
def refresh(tok)
|
data/lib/tok_access/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tok_access
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yonga9121
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
96
|
+
rubygems_version: 2.6.13
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: Handle authentication of your users using tokens.
|