Browse Source

:wrench: Apporte des modifications de rétro-compatibilité

master
Shikiryu 1 year ago
parent
commit
8f76ad0ae7
2 changed files with 7 additions and 5 deletions
  1. 5
    3
      app/Http/Controllers/LinksController.php
  2. 2
    2
      app/Providers/AuthServiceProvider.php

+ 5
- 3
app/Http/Controllers/LinksController.php View File

@@ -14,14 +14,16 @@ class LinksController extends BaseController
14 14
         /** @var User $user */
15 15
         $user = $request->user()->first();
16 16
         $email = $user->email;
17
-        
18
-        $link = $request->input('link');
17
+
18
+        $link = $request->input('u');
19 19
         $link = filter_var($link, FILTER_VALIDATE_URL);
20 20
         if ($link === false) {
21 21
             return response()->json(['error' => 'Invalid link.'], 422);
22 22
         }
23 23
 
24
-        $email_sent = mail($email, 'New link', $link);
24
+        $title = $request->input('t') ?: '';
25
+
26
+        $email_sent = mail($email, 'New link : '.$title, $link);
25 27
 
26 28
         if ($email_sent) {
27 29
             return response()->json(['info' => 'Email sent.']);

+ 2
- 2
app/Providers/AuthServiceProvider.php View File

@@ -32,9 +32,9 @@ class AuthServiceProvider extends ServiceProvider
32 32
         // the User instance via an API token or any other method necessary.
33 33
 
34 34
         $this->app['auth']->viaRequest('api', function ( Request $request) {
35
-            if ($request->input('token') && $request->input('email')) {
35
+            if ($request->input('token')) {
36 36
                 return User::where('token', $request->input('token'))
37
-                    ->where('email', $request->input('email'))
37
+//                    ->where('email', $request->input('email'))
38 38
                     ->first();
39 39
             }
40 40
         });

Loading…
Cancel
Save