ibrain-auth 0.3.4 → 0.3.6
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14ed64fc589a65550a730c8cf6a0fd809380d0fa09c4b2921035a945075aa268
|
4
|
+
data.tar.gz: 99c94235da4cca32eecaffe15d8ddaf9ddc63c406cc6d62b3655cfaaf992b560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44d8fe3cee0f97d194303d06bf8524332f50bdf7a738f35eccfdd35b456acaded077b123b172ea74728a18e2e8a7003ab90da607a71ea45c114538484e12b23e
|
7
|
+
data.tar.gz: 97e262952e408ce4e0c3e056dc0e87ce2124a418642d6f9818aa9d3a7d94d8beeb9d973b00863eb58ab76ea4a617e688a2a03cc8cc42937028413da3ec5374ec
|
@@ -11,18 +11,14 @@ module Ibrain::Auth::Mutations
|
|
11
11
|
argument :device_token, String, description: 'Device token for notificaiton', required: false
|
12
12
|
|
13
13
|
def resolve(args)
|
14
|
-
|
15
|
-
repo = ::AuthRepository.new(nil, normalize_params(args))
|
16
|
-
user = repo.sign_in
|
17
|
-
|
18
|
-
return OpenStruct.new({ user: nil, token: nil, result: false, is_verified: false }) if user.blank?
|
14
|
+
return OpenStruct.new({ user: nil, token: nil, result: false, is_verified: false }) if auth_resource.blank?
|
19
15
|
|
20
16
|
auth_resource.skip_confirmation! unless auth_resource.try(:confirmed?)
|
21
|
-
sign_in(resource_name,
|
17
|
+
sign_in(resource_name, auth_resource)
|
22
18
|
@current_user = warden.authenticate!(auth_options)
|
23
19
|
|
24
20
|
warden.set_user(current_user)
|
25
|
-
current_user.jwt_token, jti = auth_headers(request,
|
21
|
+
current_user.jwt_token, jti = auth_headers(request, auth_resource)
|
26
22
|
current_user.jti = jti
|
27
23
|
current_user.save!
|
28
24
|
|
@@ -44,7 +40,7 @@ module Ibrain::Auth::Mutations
|
|
44
40
|
|
45
41
|
private
|
46
42
|
|
47
|
-
def
|
43
|
+
def normalize_parameters(args)
|
48
44
|
ActionController::Parameters.new(args.as_json)
|
49
45
|
rescue StandardError
|
50
46
|
ActionController::Parameters.new({})
|
@@ -53,5 +49,13 @@ module Ibrain::Auth::Mutations
|
|
53
49
|
def auth_options
|
54
50
|
{ scope: resource_name }
|
55
51
|
end
|
52
|
+
|
53
|
+
def repo
|
54
|
+
::AuthRepository.new(nil, normalize_parameters)
|
55
|
+
end
|
56
|
+
|
57
|
+
def load_resource
|
58
|
+
repo.sign_in
|
59
|
+
end
|
56
60
|
end
|
57
61
|
end
|
data/lib/ibrain/auth/version.rb
CHANGED
@@ -4,16 +4,12 @@ module Ibrain
|
|
4
4
|
# frozen_string_literal: true
|
5
5
|
|
6
6
|
module Auth
|
7
|
-
VERSION = '0.3.
|
7
|
+
VERSION = '0.3.6'
|
8
8
|
|
9
9
|
def self.ibrain_auth_version
|
10
10
|
VERSION
|
11
11
|
end
|
12
12
|
|
13
|
-
def self.previous_ibrain_auth_minor_version
|
14
|
-
'0.3.2'
|
15
|
-
end
|
16
|
-
|
17
13
|
def self.ibrain_auth_gem_version
|
18
14
|
Gem::Version.new(ibrain_auth_version)
|
19
15
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibrain-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tai Nguyen Van
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: devise
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: devise-encryptable
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|