Skip to content

A free open source IT asset/license management system

route for mobile client authentication

spencerrlongg189454096bd6
diff --git a/routes/api.php b/routes/api.php
index 95a1774b74..ebae5fc5c4 100644
--- a/routes/api.php
+++ b/routes/api.php
@@ -2,6 +2,7 @@
use App\Http\Controllers\Api;
use Illuminate\Support\Facades\Route;
+use Laravel\Passport\Client;
/*
|--------------------------------------------------------------------------
@@ -25,6 +26,23 @@ Route::group(['prefix' => 'v1', 'middleware' => ['api', 'api-throttle:api']], fu
], 404);
});
+ Route::withoutMiddleware(['api'])->get('/client', function () {
+ $client = Client::firstOrCreate(
+ ['redirect' => 'com.grokability.snipeitmobile://home'],
+ [
+ 'name' => 'Snipe-IT Mobile App',
+ 'user_id' => null,
+ 'secret' => '',
+ 'personal_access_client' => false,
+ 'password_client' => false,
+ 'revoked' => false,
+ ]);
+
+ return response()->json([
+ 'client_id' => $client->id,
+ ]);
+ });
+
/**
* Account routes
*/