Я хочу создать систему аутентификации с laravel, passport и vue js.Какой лучший выбор
1 - laravel
public function login(Request $request)
{
$http = new GuzzleHttp\Client;
$response = $http->post('http://your-app.com/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => 'client-id',
'client_secret' => 'client-secret',
'username' => $request->username,
'password' => $request->password,
'scope' => '',
],
]);
return json_decode((string) $response->getBody(), true);
}
1 - vuejs
axios.post('/login', {
'username': 'xxxxxx',
'password':'xxxxxxxxx'
})
.then(response => {
//login
}).catch(error => {
//error
})
2-vuejs
axios.post('/oauth/token', {
'username': 'xxxxxx',
'password':'xxxxxxxxx',
'grant_type' => 'password',
'client_id' => 'client-id',
'client_secret' => 'client-secret',
})
.then(response => {
//login
}).catch(error => {
//error
})
в растворе 2Опасно ли помещать client_secret на стороне клиента?