Add setting for cookie name prefix to plugin settings
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- authentication, backend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- PHP
- Estrellas
- 183
- Forks
- 104
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de auth0/wordpress
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
-
Scope: Documentation
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Todos los issues de auth0/wordpress
Issues similares
-
[Sync EN] Fix session read handler docs: false reports a failure, not a missing session (#5902)Abiertosync-en
Dificultad 2/5 1-2 días Aptitud para principiantes 84/100
Los mantenedores suelen responder en 2 días
-
feature-request needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws/aws-sdk-php#3365 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 90/100
-
bug status: unverified
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
woocommerce/google-listings-and-ads#3884 ·
Los mantenedores suelen responder en 1 día