🔧 Apporte des modifications de rétro-compatibilité
This commit is contained in:
parent
7ebb888bb2
commit
8f76ad0ae7
@ -15,13 +15,15 @@ class LinksController extends BaseController
|
|||||||
$user = $request->user()->first();
|
$user = $request->user()->first();
|
||||||
$email = $user->email;
|
$email = $user->email;
|
||||||
|
|
||||||
$link = $request->input('link');
|
$link = $request->input('u');
|
||||||
$link = filter_var($link, FILTER_VALIDATE_URL);
|
$link = filter_var($link, FILTER_VALIDATE_URL);
|
||||||
if ($link === false) {
|
if ($link === false) {
|
||||||
return response()->json(['error' => 'Invalid link.'], 422);
|
return response()->json(['error' => 'Invalid link.'], 422);
|
||||||
}
|
}
|
||||||
|
|
||||||
$email_sent = mail($email, 'New link', $link);
|
$title = $request->input('t') ?: '';
|
||||||
|
|
||||||
|
$email_sent = mail($email, 'New link : '.$title, $link);
|
||||||
|
|
||||||
if ($email_sent) {
|
if ($email_sent) {
|
||||||
return response()->json(['info' => 'Email sent.']);
|
return response()->json(['info' => 'Email sent.']);
|
||||||
|
@ -32,9 +32,9 @@ class AuthServiceProvider extends ServiceProvider
|
|||||||
// the User instance via an API token or any other method necessary.
|
// the User instance via an API token or any other method necessary.
|
||||||
|
|
||||||
$this->app['auth']->viaRequest('api', function ( Request $request) {
|
$this->app['auth']->viaRequest('api', function ( Request $request) {
|
||||||
if ($request->input('token') && $request->input('email')) {
|
if ($request->input('token')) {
|
||||||
return User::where('token', $request->input('token'))
|
return User::where('token', $request->input('token'))
|
||||||
->where('email', $request->input('email'))
|
// ->where('email', $request->input('email'))
|
||||||
->first();
|
->first();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user