about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-05-02 04:30:12 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-05-02 04:30:12 +0200
commit21a73c52a7d0d0149e1058aeec155fe1c87aaeff (patch)
treef3ab8ce5d5f7c793c072d2f8f2084762b6a6ce52 /app/models
parentc4f24333002a6b1cec06f53c2910700648654487 (diff)
Check that an invite link is valid before bypassing approval mode (#10657)
* Check that an invite link is valid before bypassing approval mode

Fixes #10656

* Add tests

* Only consider valid invite links in registration controller

* fixup
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index c42f6ad8d..432078651 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -114,7 +114,7 @@ class User < ApplicationRecord
   end
 
   def invited?
-    invite_id.present?
+    invite_id.present? && invite.valid_for_use?
   end
 
   def disable!