authentication-zero 2.12.1 → 2.12.4

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: 5a4a255a118044ab6bdcf5af654088a4636a027db4d5652401087275cc14609e
4
- data.tar.gz: 935d89fb3cd66416f7bcc9932dfa8d097fd2d103e6577ed59f728bb6568d99fd
3
+ metadata.gz: e153855bfc24252626eb9ccb0381fadf99eda55f66db6d80081de90ea07eede5
4
+ data.tar.gz: a0fe741b9b4c073401fea77218fcfb2b7665041a073655bce689d0b84f5ee6ca
5
5
  SHA512:
6
- metadata.gz: 1479fde381e5a5f5f1cbd58aa8847dcf83d9ba32a6d474b239a44df5e25fea18bd758bb022112813b00890c573e55ad50ffc8f586c84531fc58b98a143a5c3c2
7
- data.tar.gz: e6452d39abad6ace236c4ab6e418b6f5fe313fc4413adf558a49893d70ef63fbb5416e601fe01d26477b379654bc135e30f2f978fce6aa7f8cb2979bf3d7e388
6
+ metadata.gz: 661fa249b995fd6c7e0076a480597c972178a9f05231ff271fc4ecd6e24916f7d0eda5a428d4e4251c2fc0c29de6ea4b8c902f1f3665557bf15e6e2aa5897533
7
+ data.tar.gz: 699dc8d96580ba018fd238ff843ceed4d07a0b623f7b3dedd8ec88db2a2fa886025f26e8b5d526a817c0209d80db9a2b0bca0bdcb8c5f3122d10017d45e0b6f0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.12.1)
4
+ authentication-zero (2.12.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.12.1"
2
+ VERSION = "2.12.4"
3
3
  end
@@ -5,10 +5,7 @@ class RegistrationsController < ApplicationController
5
5
  @user = User.new(user_params)
6
6
 
7
7
  if @user.save
8
- session = @user.sessions.create!
9
- response.set_header "X-Session-Token", session.signed_id
10
-
11
- render json: session, status: :created
8
+ render json: @user, status: :created
12
9
  else
13
10
  render json: @user.errors, status: :unprocessable_entity
14
11
  end
@@ -9,17 +9,14 @@ class User < ApplicationRecord
9
9
  kredis_string :verification_code, expires_in: 2.days
10
10
  <%- end -%>
11
11
 
12
- validates :email, presence: true, uniqueness: true
13
- validates_format_of :email, with: /\A[^@\s]+@[^@\s]+\z/
14
-
15
- validates_length_of :password, minimum: 12, allow_nil: true
16
- validates_format_of :password, with: /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/, allow_nil: true, message: "might easily be guessed"
12
+ validates :email, presence: true, uniqueness: true, format: { with: URI::MailTo::EMAIL_REGEXP }
13
+ validates :password, allow_nil: true, length: { minimum: 12 }, format: { with: /(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/ }
17
14
  <%- if options.pwned? -%>
18
15
  validates :password, not_pwned: { message: "might easily be guessed" }
19
16
  <%- end -%>
20
17
 
21
18
  before_validation do
22
- self.email = email.downcase.strip
19
+ self.email = email.try(:downcase).try(:strip)
23
20
  end
24
21
 
25
22
  before_validation if: :email_changed? do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.1
4
+ version: 2.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-14 00:00:00.000000000 Z
11
+ date: 2022-04-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: