morpho 1.1.1 → 1.1.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
  SHA256:
3
- metadata.gz: f1b8f7ef0ece2c917cec0876be3320c0116dbc38805527ace6eb9c1ce8e38236
4
- data.tar.gz: 1d90f41b51f124122cb6c592c65646d25bad6279d936188b2fada30adbef4a21
3
+ metadata.gz: 1e6a96107096cf61bdcd55849c2bbad3d5c27c085bac23afd061fab4fb508b86
4
+ data.tar.gz: 7c061fe271965fc176adde62d3856f343b9e9605ab1e0a7cb096d78d8d78409c
5
5
  SHA512:
6
- metadata.gz: 3c1b55ef40e0c560cbf4a53b9f389be420f54749ebdd21390b359e22e318709cf20e1c3e45e0abfec6c40f06f7516269de4c16264a939ac6d09c37fe7ad438c0
7
- data.tar.gz: 021b8958298735fec744065e88e095a404205c6959d3edd2badb68d996a34dbcf245494012b051c664b218eee642206e58e01238120f71bc0336ec92770c6537
6
+ metadata.gz: f6f6c509deaafd28182fd49d91fc8255aa9d52675753150d0e028e1efb698956131884f2b609c5aac80770eb74996aa47b538c2edc0ee46b52b0d415002047e3
7
+ data.tar.gz: 45d6a0a2a2aaf7551453373c40ef750c90a3f5f3caf7fa32c6124fdb45baaa5b38249e8c382be7511fa6f03d39c25922b4b4733dd77d8c6bb8b39d0f38b3a8aa
@@ -3,10 +3,10 @@ module Morpho
3
3
  include Reform::Form::ActiveRecord
4
4
 
5
5
  property :email
6
- validates :email, presence: true, email_format: true
7
- property :uid
8
- validates :uid, presence: true
9
6
  property :provider
7
+ property :uid
8
+ validates :email, presence: true, email_format: true
10
9
  validates :provider, presence: true
10
+ validates :uid, presence: true
11
11
  end
12
12
  end
@@ -3,8 +3,8 @@ module Morpho
3
3
  include Reform::Form::ActiveRecord
4
4
 
5
5
  property :email
6
- validates :email, presence: true, email_format: true
7
6
  property :password
7
+ validates :email, presence: true, email_format: true
8
8
  validates :password, presence: true
9
9
  end
10
10
  end
@@ -5,10 +5,18 @@ module Morpho
5
5
  include Reform::Form::ActiveRecord
6
6
 
7
7
  property :email
8
- validates :email, presence: true, unique: true, email_format: true
9
8
  property :password
10
- validates :password, presence: true, confirmation: true
11
9
  property :password_confirmation, virtual: true
10
+ validates :email, presence: true, unique: true, email_format: true
11
+ validates :password,
12
+ presence: true,
13
+ confirmation: true,
14
+ length: { minimum: Morpho.config.auth.password_minimum_length },
15
+ # rubocop:disable Style/HashSyntax
16
+ :'morpho/validators/contain_number' => true,
17
+ :'morpho/validators/contain_uppercase' => true,
18
+ :'morpho/validators/contain_symbol' => true
19
+ # rubocop:enable Style/HashSyntax
12
20
  validates :password_confirmation, presence: true
13
21
  end
14
22
  end
@@ -1,10 +1,12 @@
1
1
  module Morpho
2
- class JWT::AuthenticationToken
3
- def self.new(request)
4
- if request.headers[Morpho.config.jwt.header].present?
5
- request.headers[Morpho.config.jwt.header].split(' ').last
6
- else
7
- nil
2
+ module JWT
3
+ class AuthenticationToken
4
+ def self.new(request)
5
+ if request.headers[Morpho.config.jwt.header].present?
6
+ request.headers[Morpho.config.jwt.header].split(' ').last
7
+ else
8
+ nil
9
+ end
8
10
  end
9
11
  end
10
12
  end
@@ -1,10 +1,12 @@
1
1
  module Morpho
2
- class JWT::Decode
3
- def self.new(token)
4
- begin
5
- Morpho::Cipher.jwt_decode(token)
6
- rescue
7
- nil
2
+ module JWT
3
+ class Decode
4
+ def self.new(token)
5
+ begin
6
+ Morpho::Cipher.jwt_decode(token)
7
+ rescue
8
+ nil
9
+ end
8
10
  end
9
11
  end
10
12
  end
@@ -1,10 +1,12 @@
1
1
  module Morpho
2
- class JWT::Encode
3
- def self.new(payload)
4
- begin
5
- Morpho::Cipher.jwt_encode(payload)
6
- rescue
7
- nil
2
+ module JWT
3
+ class Encode
4
+ def self.new(payload)
5
+ begin
6
+ Morpho::Cipher.jwt_encode(payload)
7
+ rescue
8
+ nil
9
+ end
8
10
  end
9
11
  end
10
12
  end
@@ -1,11 +1,13 @@
1
1
  module Morpho
2
- class JWT::Payload
3
- def self.new(user)
4
- expires_at = Time.now.to_i + Morpho.config.jwt.expiration_time
5
- issued_at = Time.now.to_i
6
- token = ::Morpho::JWT::Encode.new({ exp: expires_at, iat: issued_at, email: user.email })
2
+ module JWT
3
+ class Payload
4
+ def self.new(user)
5
+ expires_at = Time.now.to_i + Morpho.config.jwt.expiration_time
6
+ issued_at = Time.now.to_i
7
+ token = ::Morpho::JWT::Encode.new({ exp: expires_at, iat: issued_at, email: user.email })
7
8
 
8
- { authentication_token: token, expires_at: expires_at, refresh_token: user.refresh_token }
9
+ { authentication_token: token, expires_at: expires_at, refresh_token: user.refresh_token }
10
+ end
9
11
  end
10
12
  end
11
13
  end
@@ -1,12 +1,14 @@
1
1
  module Morpho
2
- class JWT::Token
3
- def self.new(authentication_token)
4
- begin
5
- token = ::Morpho::JWT::Decode.new(authentication_token)
2
+ module JWT
3
+ class Token
4
+ def self.new(authentication_token)
5
+ begin
6
+ token = ::Morpho::JWT::Decode.new(authentication_token)
6
7
 
7
- HashWithIndifferentAccess.new(token.first)
8
- rescue
9
- HashWithIndifferentAccess.new
8
+ HashWithIndifferentAccess.new(token.first)
9
+ rescue
10
+ HashWithIndifferentAccess.new
11
+ end
10
12
  end
11
13
  end
12
14
  end
@@ -1,3 +1,3 @@
1
1
  module Morpho
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: morpho
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hugo Gilmar Erazo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-31 00:00:00.000000000 Z
11
+ date: 2018-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails