-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #114 from jonaspaq/fix/update-readme-file
Progress for readme
- Loading branch information
Showing
34 changed files
with
3,339 additions
and
1,314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
FROM composer:1.10 as composerTool | ||
FROM composer:2.7.7 as composerTool | ||
|
||
FROM php:7.4-fpm-alpine | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
FROM composer:1.10 | ||
FROM composer:2.7.7 | ||
|
||
RUN composer global require hirak/prestissimo | ||
# RUN composer global require hirak/prestissimo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Node | ||
name: npm | ||
|
||
on: [push] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Http\Request; | ||
use Illuminate\Foundation\Auth\VerifiesEmails; | ||
|
||
use App\User; | ||
|
||
class EmailVerificationController extends Controller | ||
{ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Email Verification Controller | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This controller is responsible for handling email verification for any | ||
| user that recently registered with the application. Emails may also | ||
| be re-sent if the user didn't receive the original email message. | ||
| | ||
*/ | ||
|
||
// use VerifiesEmails; | ||
|
||
/** | ||
* Where to redirect users after verification. | ||
* | ||
* @var string | ||
*/ | ||
protected $redirectTo = '/home'; | ||
|
||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->middleware('auth:api')->only('resend'); | ||
$this->middleware('signed')->only('verify'); | ||
$this->middleware('throttle:6,1')->only('verify', 'resend'); | ||
} | ||
|
||
/** | ||
* Mark the authenticated user's email address as verified. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return json response | ||
* | ||
* @throws \Illuminate\Auth\Access\AuthorizationException | ||
*/ | ||
public function verify(Request $request) | ||
{ | ||
$user = User::find($request->route('id')); | ||
|
||
if (! hash_equals((string) $request->route('id'), (string) $user->getKey())) { | ||
throw new AuthorizationException; | ||
} | ||
|
||
if (! hash_equals((string) $request->route('hash'), sha1($user->getEmailForVerification()))) { | ||
throw new AuthorizationException; | ||
} | ||
|
||
if ($user->hasVerifiedEmail()) { | ||
return response()->json(['message' => 'Email already verified'], 403); | ||
} | ||
|
||
$user->markEmailAsVerified(); | ||
// if ($user->markEmailAsVerified()) { | ||
// event(new Verified($user)); | ||
// } | ||
|
||
return response()->json(['message' => 'Successfully verified email.']); | ||
} | ||
|
||
/** | ||
* Resend the email verification notification. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return json response | ||
*/ | ||
public function resend(Request $request) | ||
{ | ||
$user = User::find($request->user()->id); | ||
|
||
if ($user->hasVerifiedEmail()) { | ||
return response()->json(['message' => 'Email is already verified.']); | ||
} | ||
|
||
$user->sendEmailVerificationNotification(); | ||
|
||
return response()->json(['message' => 'Email verification sent.']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.