Google_Calendar_Helpers::auth_redirect_when_error( string $nonce = '', string $invoked_errors = '' )

Method auth_redirect_when_error


Description Description

Redirects if nonce is invalid, or if auth is successful.


Top ↑

Parameters Parameters

$nonce

(Optional) The nonce.

Default value: ''

$invoked_errors

(Optional) The displayed error message.

Default value: ''


Top ↑

Return Return

(Uncanny_Automatorvoid.)


Source Source

File: src/integrations/google-calendar/helpers/google-calendar-helpers.php

	protected function auth_redirect_when_error( $nonce = '', $invoked_errors = '' ) {

		// Check nonce.
		if ( ! wp_verify_nonce( $nonce, 'automator_api_google_calendar_authorize' ) ) {
			$this->redirect_with_error( 'invalid_nonce' );
		}

		// Redirect if there are any errors.
		if ( ! empty( $invoked_errors ) ) {
			$this->redirect_with_error( str_replace( ' ', '_', strtolower( rawurlencode( $invoked_errors ) ) ) );
		}

	}