mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-27 06:01:54 +03:00
Removed token 'client' text, avoid confusion w/ oAuth
- Instead have a token_id and a secret. - Displayed a 'Token ID' and 'Token Secret'.
This commit is contained in:
@ -44,14 +44,14 @@ class UserApiTokenController extends Controller
|
||||
|
||||
$token = (new ApiToken())->forceFill([
|
||||
'name' => $request->get('name'),
|
||||
'client_id' => Str::random(32),
|
||||
'client_secret' => Hash::make($secret),
|
||||
'token_id' => Str::random(32),
|
||||
'secret' => Hash::make($secret),
|
||||
'user_id' => $user->id,
|
||||
'expires_at' => $expiry
|
||||
]);
|
||||
|
||||
while (ApiToken::query()->where('client_id', '=', $token->client_id)->exists()) {
|
||||
$token->client_id = Str::random(32);
|
||||
while (ApiToken::query()->where('token_id', '=', $token->token_id)->exists()) {
|
||||
$token->token_id = Str::random(32);
|
||||
}
|
||||
|
||||
$token->save();
|
||||
|
Reference in New Issue
Block a user