1
0
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:
Dan Brown
2019-12-29 20:07:28 +00:00
parent 832fbd65af
commit 692fc46c7d
6 changed files with 24 additions and 24 deletions

View File

@ -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();