Skip to content

Commit

Permalink
fix(theme): preview cookie name prefix to STYXKEY
Browse files Browse the repository at this point in the history
  • Loading branch information
rpeterman-gp committed Mar 14, 2024
1 parent cefa860 commit 5b0693c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wp-content/themes/the-world/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ function tw_init_set_auth_cookie() {
$auth = new WPGraphQL\JWT_Authentication\Auth();
$secret_key = $auth->get_secret_key();

if ( $secret_key && ! isset( $_COOKIE['wp-can_preview'] ) ) {
if ( $secret_key && ! isset( $_COOKIE['STYXKEY-can_preview'] ) ) {
$hostname = wp_parse_url( get_site_url(), PHP_URL_HOST );
// NOTE: Regex assumes front-end domains will use single segment TLD's.
$domain = trim( preg_replace( '~.*?\.?((?:\.?[\w_-]+){2})$~', '$1', $hostname ), '.' );
$token = $auth->get_refresh_token( wp_get_current_user() );

setcookie(
'wp-can_preview',
'STYXKEY-can_preview',
$token,
array(
'expires' => 0,
Expand Down

0 comments on commit 5b0693c

Please sign in to comment.