rails_jwt_admin 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: fbb78d3abec7f464ffe3c382fe92d6f95f14203b11809dd838e6c25d19914586
4
- data.tar.gz: 9e3eebce3d7fd83f2e5b2e85799080fe7e9e5c7cb561bbb3947b2356afa536b0
3
+ metadata.gz: cea14329748e5f97b29a967644804f20bd8e0f4f60f7b963bc7a3c74f54abaae
4
+ data.tar.gz: 825d36984443e9279231464d349b51235c4bc2c7c6b50aa2182450a049d0dfc1
5
5
  SHA512:
6
- metadata.gz: 3cf2345396a1c0eedfb463084dd60e1c0a0b4cd8d0491393e858d5984841231a278da0b3f7bf2074759c85dd24007d83a1278f6a4da58264d5a3afecf8dee09a
7
- data.tar.gz: 5fa3a5d0a803a666116b211e6b0be9321833b8f580df81a01bbe1fc38a0796de13d67f94bdb9548d9e76cc3f88f8077545a230e01a3b4577c4f45ff212591af5
6
+ metadata.gz: 952e84d9bfbdf0a7def0d1fbaf6ddcf9cf57a21e1e96cdb971bcedf49140f22a6fa5f3bc9e9b79290e1318f560ad60618b396a1ef941c7c4094963b27a6461d5
7
+ data.tar.gz: 4f3cdfccb963bf566902c9f56e8b6d085b2e646ed429eed09c13c1a9ed10462fd7b9cb691cf10e80f706cc9abe394146096c2164825c62ae951e16a88b6da7d6
data/README.md CHANGED
@@ -3,10 +3,6 @@
3
3
 
4
4
  ## installation
5
5
  ```shell
6
- # gem
7
- gem install 'rails_jwt_admin'
8
-
9
- # rails
10
6
  # 1. add gen & bundle install
11
7
  gem 'rails_jwt_admin'
12
8
 
@@ -17,6 +13,16 @@ rails g rails_jwt_admin:install
17
13
  rake db:migrate
18
14
  ```
19
15
 
16
+ ## seed
17
+ ```rb
18
+ RailsJwtAdmin::User.create(
19
+ username: "admin",
20
+ email: "example@qq.com",
21
+ password: "123123",
22
+ password_confirmation: "123123"
23
+ )
24
+ ```
25
+
20
26
  ## resources
21
27
  - https://edgeapi.rubyonrails.org/classes/Rails/Engine.html
22
28
  - https://guides.rubyonrails.org/engines.html
@@ -2,6 +2,8 @@ module RailsJwtAdmin
2
2
  class User < ApplicationRecord
3
3
  has_secure_password
4
4
 
5
+ validates_uniqueness_of :username, :email
6
+
5
7
  def token
6
8
  { token: Token.encode(user_id: self.id) }
7
9
  end
@@ -1,3 +1,3 @@
1
1
  module RailsJwtAdmin
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
data/lib/vendors/token.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require "rails_jwt_admin/engine"
2
2
 
3
3
  module RailsJwtAdmin
4
- puts "load token"
5
-
6
4
  class Token
7
5
  def self.encode(payload)
8
6
  JWT.encode(payload, Rails.application.secrets.secret_key_base)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_jwt_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - afeiship
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-02 00:00:00.000000000 Z
11
+ date: 2021-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -44,7 +44,7 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
- description:
47
+ description:
48
48
  email:
49
49
  - 1290657123@qq.com
50
50
  executables: []
@@ -71,7 +71,7 @@ homepage: https://github.com/afeiship/rails_jwt_admin
71
71
  licenses:
72
72
  - MIT
73
73
  metadata: {}
74
- post_install_message:
74
+ post_install_message:
75
75
  rdoc_options: []
76
76
  require_paths:
77
77
  - lib
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubygems_version: 3.0.3
90
- signing_key:
90
+ signing_key:
91
91
  specification_version: 4
92
92
  summary: Summary of RailsJwtAdmin.
93
93
  test_files: []