MCPcopy Create free account
hub / github.com/CoderOpen/waimai / handle

Method handle

app/Http/Middleware/ChiHe/UserAuth.php:26–35  ·  view source on GitHub ↗
($request, Closure $next)

Source from the content-addressed store, hash-verified

24 */
25
26 public function handle($request, Closure $next)
27 {
28 if (!Auth::guard('chi_he')->check()) {
29 return response()->json(['code' => 403, 'msg' => 'please login', 'data' => [],]);
30 }
31 $user = Auth::guard('chi_he')->user();
32 $request->offsetSet('user_id', $user->id);
33 $request->offsetSet('open_id', $user->open_id);
34 return $next($request);
35 }
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected