Download app/Http/Controllers/Chatbot/ChatbotTokenController.php from pnacorp/magicai: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/pnacorp/magicai/resolve/main/app/Http/Controllers/Chatbot/ChatbotTokenController.php
- Command line
-
hf download hf://pnacorp/magicai/app/Http/Controllers/Chatbot/ChatbotTokenController.php
-
curl -L -o ChatbotTokenController.php https://huggingface.co/pnacorp/magicai/resolve/main/app/Http/Controllers/Chatbot/ChatbotTokenController.php
524 Bytes
| declare(strict_types=1); | |
| namespace App\Http\Controllers\Chatbot; | |
| use App\Support\Chatbot\ChatbotHelper; | |
| use Illuminate\Http\Request; | |
| class ChatbotTokenController | |
| { | |
| public function __invoke(Request $request) | |
| { | |
| $token = ChatbotHelper::generateJWT($request->input('appKey')); | |
| if (! $token) { | |
| return response()->json([ | |
| 'message' => 'Unauthorized', | |
| ], 401); | |
| } | |
| return response()->json([ | |
| 'token' => $token, | |
| ]); | |
| } | |
| } | |