changed config to token instead of api key

This commit is contained in:
Rudis Muiznieks 2023-09-25 12:35:12 -05:00
parent a8601314e7
commit 74dd5d0170
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
3 changed files with 7 additions and 5 deletions

View File

@ -1,13 +1,14 @@
<?php
$kagi_api_key = FreshRSS_Context::$user_conf->kagi_api_key;
$kagi_token = FreshRSS_Context::$user_conf->kagi_token;
?>
<form action="<?php echo _url('extension', 'configure', 'e', urlencode($this->getName())); ?>" method="post">
<input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
<p><?php echo _t('ext.kagiSummarizer.configure.kagi_token_help'); ?></p>
<div class="form-group">
<label class="group-name" for="kagi_api_key"><?php echo _t('ext.kagiSummarizer.configure.kagi_api_key'); ?></label>
<label class="group-name" for="kagi_token"><?php echo _t('ext.kagiSummarizer.configure.kagi_token'); ?></label>
<div class="group-controls">
<input type="text" name="kagi_api_key" id="kagi_api_key" value="<?php echo $kagi_api_key; ?>">
<input type="text" name="kagi_token" id="kagi_token" value="<?php echo $kagi_token; ?>">
</div>
</div>
<div class="form-group form-actions">

View File

@ -16,7 +16,7 @@ class KagiSummarizerExtension extends Minz_Extension {
$this->registerTranslates();
if (Minz_Request::isPost()) {
FreshRSS_Context::$user_conf->kagi_api_key = Minz_Request::param('kagi_api_key', '');
FreshRSS_Context::$user_conf->kagi_token = Minz_Request::param('kagi_token', '');
FreshRSS_Context::$user_conf->save();
}
}

View File

@ -3,7 +3,8 @@
return array(
'kagiSummarizer' => array(
'configure' => array(
'kagi_api_key' => 'Kagi API Key'
'kagi_token' => 'Kagi Token',
'kagi_token_help' => 'Copy and paste the "Session Link" from you <a href="https://kagi.com/settings?p=user_details" target="_blank">Kagi Account</a> settings.'
)
)
);