0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-18 14:21:05 +00: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
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
6 changed files with 24 additions and 24 deletions
app/Http/Controllers

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