Skip to content

Commit

Permalink
sending contextual information with verification requests. Not nullin…
Browse files Browse the repository at this point in the history
…g tokens when verifying.
  • Loading branch information
MelonSmasher committed Jun 15, 2017
1 parent 4c07b86 commit 22ad60c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/Http/Controllers/API/V1/TokenVerificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ public function verify(Request $request, $token = null)
$type = strtolower($reflection->getShortName());

$response['id'] = $verified->id;
$response['verification_callback'] = $verified->verification_callback;
$response['upstream_app_name'] = $verified->upstream_app_name;

switch ($type) {
case 'email':
$route = route('api.emails.show', ['id' => $verified->id]);
$response['confirmation_from'] = $verified->confirmation_from;
$response['type'] = 'email';
$response['message'] = 'Email has been verified successfully.';
break;
Expand Down
2 changes: 0 additions & 2 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,10 @@ function verifyToken($token)
if (!empty($email) && !empty($phone)) {
abort(500, 'Duplicate Token Exception!');
} elseif (!empty($email)) {
$email->verification_token = null;
$email->verified = true;
$email->save();
return $email;
} elseif (!empty($phone)) {
$phone->verification_token = null;
$phone->verified = true;
$phone->save();
return $phone;
Expand Down

0 comments on commit 22ad60c

Please sign in to comment.