ibrain-auth 0.3.16 → 0.3.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60a113e3b1a3c4a9d36537db0135bb75cdcfde931553aad2cfcaf5c6f61d2eb3
4
- data.tar.gz: 047755a00465c7718633deee0ae819f13d7eb91cbb13ff8c63bb7615a16edfad
3
+ metadata.gz: 8e5275d926c383ed4d378429ccda0e117adc23a3307d3f70273e960b249d39a8
4
+ data.tar.gz: b6e779e9394a733f366ef336d505e185ee2cce7265377dc4b4d22a456c73e3a5
5
5
  SHA512:
6
- metadata.gz: c65958057e091667cf5aff4c6fae97ab0d99d4a905817e16f3c0457b2795e08efb42e1622f752c431f4afb19a37856ca0ab93c66a0dea379b9505299daf7eae4
7
- data.tar.gz: df1ed03ef6ed2ca98697df98c27ef82b0f9d7b464c189ca72d957cb40d635e0a181b583f77a61102a88ef439276b36287740ecd389228db8fc4e634fb30a2845
6
+ metadata.gz: 0667ba68efb071fda88fda0e98ba8a3abb0feb56198935e96a85c40aeee14f80f866c69867b53525a1012778f2ad8899fd0378dbec370d96aceab3c45a16498f
7
+ data.tar.gz: b7a7a9b17f82a39de88affcc9eef1e60eb6d398f69a2ed76fa3ffe7f57ce7869517620ec32d299c89ea1ae1f99ca3a132847b1cea20b108da5ebcd7f30faaf7b
@@ -19,7 +19,11 @@ module Ibrain::Mutations
19
19
  auth_resource.skip_confirmation! unless auth_resource.try(:confirmed?)
20
20
  sign_in(resource_name, auth_resource)
21
21
  @current_user = warden.authenticate!(auth_options)
22
-
22
+
23
+ if !current_user.try(:is_activated?) && Ibrain::Config.is_require_activated_account
24
+ raise ActionController::InvalidAuthenticityToken, I18n.t('ibrain.errors.account.is_deactivated')
25
+ end
26
+
23
27
  warden.set_user(current_user)
24
28
  current_user.jwt_token, jti = auth_headers(request, auth_resource)
25
29
  current_user.jti = jti
@@ -15,7 +15,11 @@ module Ibrain::Mutations
15
15
  auth_resource.skip_confirmation! unless auth_resource.try(:confirmed?)
16
16
  sign_in(resource_name, auth_resource)
17
17
  @current_user = warden.authenticate!(auth_options)
18
-
18
+
19
+ if !current_user.try(:is_activated?) && Ibrain::Config.is_require_activated_account
20
+ raise ActionController::InvalidAuthenticityToken, I18n.t('ibrain.errors.account.is_deactivated')
21
+ end
22
+
19
23
  warden.set_user(current_user)
20
24
  current_user.jwt_token, jti = auth_headers(request, auth_resource)
21
25
  current_user.jti = jti
@@ -12,5 +12,6 @@ en:
12
12
  not_found: Account not found
13
13
  incorrect: Username or Password is incorrect!
14
14
  not_verified: Please verify your account before login
15
+ is_deactivated: Account inactive
15
16
  custom_token:
16
17
  not_retrieve_uid: Can not retrieve uid
@@ -7,10 +7,11 @@ ja:
7
7
  errors:
8
8
  session:
9
9
  invalid_session: 無効なログインセッション。 もう一度やり直してください!
10
- expired_session: ログインセッションが期限切れになりました。
10
+ expired_session: ログインセッションが期限切れになりました。
11
11
  account:
12
12
  not_found: アカウントが見つかりません
13
13
  incorrect: ユーザー名またはパスワードが正しくありません!
14
14
  not_verified: ログインする前にアカウントを確認してください
15
+ is_deactivated: このアカウントは無効です。
15
16
  custom_token:
16
17
  not_retrieve_uid: uid を取得できません
@@ -12,5 +12,6 @@ vi:
12
12
  not_found: Không tìm thấy tài khoản
13
13
  incorrect: Tài khoản hoặc mật khẩu không chính xác!
14
14
  not_verified: Vui lòng xác minh tài khoản của bạn trước khi đăng nhập
15
+ is_deactivated: Tài khoản chưa được xác thực.
15
16
  custom_token:
16
17
  not_retrieve_uid: Lấy thông tin uid của người dùng thất bại
@@ -4,7 +4,7 @@ module Ibrain
4
4
  # frozen_string_literal: true
5
5
 
6
6
  module Auth
7
- VERSION = '0.3.16'
7
+ VERSION = '0.3.17'
8
8
 
9
9
  def self.ibrain_auth_version
10
10
  VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ibrain-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.16
4
+ version: 0.3.17
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: 2023-01-31 00:00:00.000000000 Z
11
+ date: 2023-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise