File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 22
33namespace Jrean \UserVerification \Exceptions ;
44
5- class VerificationException extends \Exception
5+ use Exception ;
6+
7+ class ModelNotCompliantException extends Exception
68{
79 /**
810 * The exception description.
Original file line number Diff line number Diff line change 22
33namespace Jrean \UserVerification \Exceptions ;
44
5- class UserNotFoundException extends \Exception
5+ use Exception ;
6+
7+ class UserNotFoundException extends Exception
68{
79 /**
810 * The exception description.
911 *
1012 * @var string
1113 */
12- protected $ message = 'No user found for that email adresse. ' ;
14+ protected $ message = 'No user found for the given email adresse. ' ;
1315}
Original file line number Diff line number Diff line change 88use Illuminate \Support \Str ;
99use Illuminate \Support \Facades \Crypt ;
1010use Illuminate \Support \Facades \DB ;
11- use Jrean \UserVerification \Exceptions \VerificationException ;
11+ use Jrean \UserVerification \Exceptions \ModelNotCompliantException ;
12+ use Jrean \UserVerification \Exceptions \UserNotFoundException ;
1213
1314class UserVerification
1415{
@@ -184,14 +185,16 @@ public function decryptEmailFromToken($token)
184185 * @param string $token
185186 * @return bool
186187 *
187- * @throws \Jrean\UserVerification\Exceptions\VerificationException
188+ * @throws \Jrean\UserVerification\Exceptions\ModelNotCompliantException
188189 */
189190 protected function saveToken (AuthenticatableContract $ user , $ token )
190191 {
191192 if (! $ this ->isCompliant ($ user )) {
192- throw new VerificationException ();
193+ throw new ModelNotCompliantException ();
193194 }
194195
196+ $ user ->verified = false ;
197+
195198 $ user ->verification_token = $ token ;
196199
197200 return $ user ->save ();
You can’t perform that action at this time.
0 commit comments