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:
parent
832fbd65af
commit
692fc46c7d
6 changed files with 24 additions and 24 deletions
app/Http/Controllers
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue