Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Zoom_Helpers::refresh_token()

refresh_token


Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Parameters Parameters

$client

(Required)


Top ↑

Return Return

(void)


Source Source

File: src/integrations/zoom/helpers/zoom-helpers.php

	public function refresh_token() {
		$client = array();
		// Get the API key and secret
		$consumer_key    = trim( get_option( 'uap_automator_zoom_api_consumer_key', '' ) );
		$consumer_secret = trim( get_option( 'uap_automator_zoom_api_consumer_secret', '' ) );
		if ( empty( $consumer_key ) || empty( $consumer_secret ) ) {
			return false;
		}
		// Set the token expiration to 1 minute as recommended in the docuemntation
		$client['expires'] = time() + 60;
		$payload = array(
			'iss' => $consumer_key,
			'exp' => $client['expires'],
		);
		// Generate the access token using the JWT library
		$token = JWT::encode( $payload, $consumer_secret );
		$client['access_token'] = $token;
		$client['refresh_token'] = $token;
		// Cache it in settings
		update_option( '_uncannyowl_zoom_settings', $client );
		return $client;
	}