ruby_magic_link 1.0.1 → 1.0.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: 265ece5de19cf999679f6006cc8aa2ac2df56284c55e50acc44825d0ffa013fc
4
- data.tar.gz: bf4848c3854c3fda2fa7858ddc79b7fdb39e36896548a580bc6fa51774d16160
3
+ metadata.gz: 205f84fd453224203038a00c21e6af97a9854776dc878e0cad7e05f80e3b3045
4
+ data.tar.gz: 6058775a727aac913328f699f650540ae5d4bdc16c280ce1346f9ea959c2a29e
5
5
  SHA512:
6
- metadata.gz: 95c41caf541fa90039f2231b994723d4d48ddba1aab9eb26bb4b2f09e0502997cf710d3e777fe89d423f5f572b3c66809c93604a0c66acfdb9bce2b81f91d137
7
- data.tar.gz: c4eaa959ba5d81dda9db387f53131924f7089c00c58e11b7e402f23d5860bb8c8ad41460552dd393192d3f459264ec16271fb45fd74cc033c1ae0275131ee9b4
6
+ metadata.gz: 4a371c23f1f5dda6c2f155249a4bdc9a54d1abb0abee56f3c680539533f377d1ec8ea7f2bccb29e63cf935adc60e08e76bd90160043190651118d90c4c18ee6a
7
+ data.tar.gz: 643eca2c3d8ffd8c03fc66525899edd2cc9331bfc3813072d225cfcb4e4a4d2888893b382477f336a1a7fea6ad283ab0be81a161dfcc4e9bcfb468a806e26ce5
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Gem Version](https://badge.fury.io/rb/ruby_magic_link.svg)](https://badge.fury.io/rb/ruby_magic_link)
1
2
  ![CI](https://github.com/igorkorepanov/ruby_magic_link/actions/workflows/main.yml/badge.svg)
2
3
 
3
4
  # RubyMagicLink
@@ -13,7 +13,11 @@ module RubyMagicLink
13
13
 
14
14
  def create(payload, expires_in: nil)
15
15
  data = { payload: payload }
16
- data[:expires_in] = Time.now.to_i + expires_in if expires_in
16
+ if expires_in
17
+ raise(StandardError, '`expires_at` must be an Integer') unless expires_in.is_a? Integer
18
+
19
+ data[:expires_in] = Time.now.to_i + expires_in
20
+ end
17
21
  iv = OpenSSL::Random.random_bytes(16)
18
22
  encrypted_data = encrypt(JSON.generate(data), RubyMagicLink.config.secret_key, iv)
19
23
  Base64.urlsafe_encode64(Base64.urlsafe_encode64(iv) + DELIMITER + encrypted_data)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyMagicLink
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_magic_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Korepanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-08 00:00:00.000000000 Z
11
+ date: 2024-02-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Magic links for ruby web applications
14
- email: noemail@example.com
14
+ email: korepanovigor87@gmail.com
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []