mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
feat: Hooks added to Authorizing URL functionality (#806)
This commit is contained in:
@@ -350,12 +350,14 @@ class Customer_Type {
|
||||
}
|
||||
|
||||
// Build nonced url as an unauthenticated user.
|
||||
$nonce_name = woographql_setting( 'cart_url_nonce_param', '_wc_cart' );
|
||||
$url = add_query_arg(
|
||||
[
|
||||
'session_id' => $customer_id,
|
||||
$nonce_name => woographql_create_nonce( "load-cart_{$customer_id}" ),
|
||||
],
|
||||
$nonce_name = woographql_setting( 'cart_url_nonce_param', '_wc_cart' );
|
||||
$query_params = [
|
||||
'session_id' => $customer_id,
|
||||
$nonce_name => woographql_create_nonce( "load-cart_{$customer_id}" ),
|
||||
];
|
||||
$query_params = apply_filters( 'graphql_cart_url_query_params', $query_params, $customer_id, $source );
|
||||
$url = add_query_arg(
|
||||
$query_params,
|
||||
site_url( woographql_setting( 'authorizing_url_endpoint', 'transfer-session' ) )
|
||||
);
|
||||
|
||||
@@ -400,12 +402,14 @@ class Customer_Type {
|
||||
}
|
||||
|
||||
// Build nonced url as an unauthenticated user.
|
||||
$nonce_name = woographql_setting( 'checkout_url_nonce_param', '_wc_checkout' );
|
||||
$url = add_query_arg(
|
||||
[
|
||||
'session_id' => $customer_id,
|
||||
$nonce_name => woographql_create_nonce( "load-checkout_{$customer_id}" ),
|
||||
],
|
||||
$nonce_name = woographql_setting( 'checkout_url_nonce_param', '_wc_checkout' );
|
||||
$query_params = [
|
||||
'session_id' => $customer_id,
|
||||
$nonce_name => woographql_create_nonce( "load-checkout_{$customer_id}" ),
|
||||
];
|
||||
$query_params = apply_filters( 'graphql_checkout_url_query_params', $query_params, $customer_id, $source );
|
||||
$url = add_query_arg(
|
||||
$query_params,
|
||||
site_url( woographql_setting( 'authorizing_url_endpoint', 'transfer-session' ) )
|
||||
);
|
||||
|
||||
@@ -454,12 +458,14 @@ class Customer_Type {
|
||||
}
|
||||
|
||||
// Build nonced url as an unauthenticated user.
|
||||
$nonce_name = woographql_setting( 'account_url_nonce_param', '_wc_account' );
|
||||
$url = add_query_arg(
|
||||
[
|
||||
'session_id' => $customer_id,
|
||||
$nonce_name => woographql_create_nonce( "load-account_{$customer_id}" ),
|
||||
],
|
||||
$nonce_name = woographql_setting( 'account_url_nonce_param', '_wc_account' );
|
||||
$query_params = [
|
||||
'session_id' => $customer_id,
|
||||
$nonce_name => woographql_create_nonce( "load-account_{$customer_id}" ),
|
||||
];
|
||||
$query_params = apply_filters( 'graphql_account_url_query_params', $query_params, $customer_id, $source );
|
||||
$url = add_query_arg(
|
||||
$query_params,
|
||||
site_url( woographql_setting( 'authorizing_url_endpoint', 'transfer-session' ) )
|
||||
);
|
||||
|
||||
|
||||
@@ -363,6 +363,8 @@ class Protected_Router {
|
||||
$this->redirect_to_home();
|
||||
}
|
||||
|
||||
do_action( 'woographql_process_auth_request_nonce_verified' );
|
||||
|
||||
// If Session ID is a user ID authenticate as session user.
|
||||
if ( 0 !== absint( $session_id ) ) {
|
||||
$user_id = absint( $session_id );
|
||||
|
||||
Reference in New Issue
Block a user