Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add setting for cookie name prefix to plugin settings

オープン
#892 コメント 5 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
php, wordpress

調査の方向性

Start with the functions.php workaround and the plugins_loaded entry point, then trace wpAuth0()->getSdk() through its configuration and the existing plugin settings. Add an optional admin setting for the cookie-name prefix, and confirm that it updates the session and transient storage IDs for the Pantheon use case.

索引モデルが issue の本文から書いたものです。

説明

Good First Issue Scope: Improvement
Checklist
  • I have looked into the Readme and the documentation, and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved

v5 appears to have removed the hooks mentioned in this issue. I am using pantheon, and need to prefix the cookie names with STYXKEY_ to avoid cookies being lost due to the CDN.

Describe the ideal solution

The ideal solution would be to add an optional field to the plugin's settings in the WordPress admin dashboard to set the SDK configuration object's storage IDs with the prefix. This would save custom work needing to be done to achieve this with the plugin.

Alternatives and current workarounds

I achieved a workaround by adding a plugins_loaded action in functions.php of my site as follows:

// change the auth0 cookie name to be prefixed with STYXKEY_ for Pantheon
function update_auth0_cookie_storage_id()
{
  $auth0SDK = wpAuth0()->getSdk();
  $auth0Config = $auth0SDK->configuration();
  $storageId = 'STYXKEY_' . $auth0Config->getSessionStorageId();
  $transientId = 'STYXKEY_' . $auth0Config->getTransientStorageId();
  $auth0Config->setSessionStorageId($storageId);
  $auth0Config->setTransientStorageId($transientId);
  $auth0Config->setSessionStorage(new CookieStore($auth0Config, $auth0Config->getSessionStorageId()));
  $auth0Config->setTransientStorage(new CookieStore($auth0Config, $auth0Config->getTransientStorageId()));
  $auth0SDK->setConfiguration($auth0Config);
}
add_action('plugins_loaded', update_auth0_cookie_storage_id());

I was able to update the configuration of the SDK by using this method. However, it took me a while of reading the source code of the plugin and SDK to find this solution, so I am proposing adding a setting in the Plugin settings on the WordPress admin dashboard.

Additional context

Pantheon Cache Docs for reference here.

主要言語
PHP
スター
182
フォーク
103
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

auth0/wordpress のほかの issue

auth0/wordpress の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。