2

I'm using laravel sanctum and I add to middleware to my route:

Route::group(['middleware' => 'auth:sanctum'], function () {
    Route::post('/sms-log',[SmsLogController::class, 'store'] );
});

But insomnia wants me to sign in: insomnia_ss

when I remove middleware from API route working as expected. so how can I add basic auth?

4

1 回答 1

2

在失眠症中添加一个标题,这样您就不会被重定向到登录路由,而是会得到一个 "message":" Not authenticated."

Accept: application/json
于 2021-03-01T12:34:49.090 回答