wordjelly-auth 1.4.8 → 1.4.9

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: e1bd487cfd90d83d849e828c1f4663fee4f42886302245a749ec6b24a52528a8
4
- data.tar.gz: f45d4d12dda43daad3ef93991093f00424f35eaa26a17f5a3c257fdd934660c5
3
+ metadata.gz: 1ca38b4329d89f90793673c6d64b4ce7dd3aba5e729358c2fd78062d2125857d
4
+ data.tar.gz: b96bcca2319d39b9053ac397c592427fd738b9229484ebab19b95253bd22ed59
5
5
  SHA512:
6
- metadata.gz: 9fb59025c76fca730389eeec63cefff8a8a02785ef9abb18a59b3884a27fa595b2f29d18ae90d8000bab79e542c4b5149910357c1171e731845227242f5815b2
7
- data.tar.gz: 7956fd9bbb9fa262f4865bc9b5783a1250a1b116c53d18a53e67fcc9077092d616f163fc340397e2fbb840c9e47ca8e6717c8b668f17843b21bcd5c6d4571692
6
+ metadata.gz: 58ffe5cf4a8a233bb3665801428ed4261a82d1949633e854f723d9ab60dc7759ccd861f856cf771da7a0f9c3a9fbf6de8cfd9204a0b0632d763d03bc722a14ea
7
+ data.tar.gz: 76c0c19a7607b59100638c58149cfce7dba3f8b7b63678ec2823dd73ff0d29e706355f0bb7c8f76f4ebeb1eacbfe4578b621e1062784ef7baa0bc4f3a2d34dca
@@ -1,6 +1,6 @@
1
1
  class Auth::ProfilesController < Auth::ApplicationController
2
2
 
3
- respond_to :json, :html, :json
3
+ respond_to :json, :html
4
4
 
5
5
  CONDITIONS_FOR_TOKEN_AUTH = [:get_user_id,:show,:update,:set_proxy_resource, :edit]
6
6
 
@@ -414,6 +414,12 @@ module SimpleTokenAuthentication
414
414
 
415
415
  module ActsAsTokenAuthenticatable
416
416
 
417
+ ## if the skip_authentication_token_generation carries
418
+ ## any value it will not regenerate the authentication token.
419
+ ## this can be useful if you are updating the user, but not his
420
+ ##
421
+ mattr_accessor :skip_authentication_token_regeneration
422
+
417
423
  def regenerate_token
418
424
  self.authentication_token = generate_authentication_token(token_generator)
419
425
  raise "please set a field called: encrypted_authentication_token on your user model" unless self.respond_to? :encrypted_authentication_token
@@ -422,8 +428,11 @@ module SimpleTokenAuthentication
422
428
  end
423
429
 
424
430
  ## CHANGE THE AUTHENTICATION TOKEN WHENEVER THE USER IS SAVED. IT DOESNT MATTER IF THERE IS AN EXISTING AUTHENTICATION TOKEN OR NOT.
431
+ ## so this is happening, we will have to skip this hook.
432
+ ## so we will have to mod this to check for an accessor.
433
+ ## otherwise it will screw up totally.
425
434
  def ensure_authentication_token
426
- regenerate_token
435
+ regenerate_token if self.skip_authentication_token_regeneration.blank?
427
436
  end
428
437
  end
429
438
 
@@ -437,7 +446,7 @@ module SimpleTokenAuthentication
437
446
  ## to prevent that from happening, we ignore the fallback if we are already signed in.
438
447
  def fallback!(entity, fallback_handler)
439
448
 
440
- puts "came to fallback!"
449
+ # puts "came to fallback!"
441
450
 
442
451
  return if self.signed_in?
443
452
 
@@ -478,17 +487,17 @@ module SimpleTokenAuthentication
478
487
 
479
488
  def find_record_from_identifier(entity)
480
489
  ## you are supposed to find the record using one of the other parameters.
481
- puts "came to find entity from identifier -----------------------------------"
490
+ #puts "came to find entity from identifier -----------------------------------"
482
491
  additional_identifiers = entity.get_additional_identifiers_from_headers(self)
483
492
 
484
- puts "additional_identifiers"
493
+ #puts "additional_identifiers"
485
494
  puts additional_identifiers
486
495
 
487
496
  app_id_value = additional_identifiers["X-User-Aid"]
488
497
  user_es_value = additional_identifiers["X-User-Es"]
489
498
  token = entity.get_token_from_params_or_headers(self)
490
499
 
491
- puts "token:#{token}"
500
+ #puts "token:#{token}"
492
501
 
493
502
  if token
494
503
 
data/lib/auth/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Auth
2
- VERSION = "1.4.8"
2
+ VERSION = "1.4.9"
3
3
  end