[PLUGIN][Pinboard] Change token to user user ID rather than nickname, to avoid complications with it possibly changing
This commit is contained in:
@@ -25,7 +25,7 @@ class Settings extends Controller
|
||||
public static function setup()
|
||||
{
|
||||
$user = Common::ensureLoggedIn();
|
||||
$token = Token::get(nickname: null, token: null, user: $user);
|
||||
$token = Token::get(id: null, token: null, user: $user);
|
||||
$enabled = ($token?->getEnabled() ?? false);
|
||||
$form = Form::create([
|
||||
['token', TextType::class, ['label' => _m('The token used to authenticate you via the Pinboard-compatible API'), 'data' => $token?->getUserTokenString(), 'disabled' => true]],
|
||||
@@ -79,7 +79,7 @@ class Settings extends Controller
|
||||
} else {
|
||||
throw new ClientException(_m('Invalid form submission'));
|
||||
}
|
||||
Cache::set(Token::cacheKeys($user->getNickname())['user-token'], $token);
|
||||
Cache::set(Token::cacheKeys($user->getId())['user-token'], $token);
|
||||
DB::flush();
|
||||
return Form::forceRedirect($form, $request);
|
||||
}
|
||||
|
Reference in New Issue
Block a user