PluginProbe
SureMail – SMTP and Email Logs Plugin with Amazon SES, Postmark, and Other Providers / 2.0.0
SureMail – SMTP and Email Logs Plugin with Amazon SES, Postmark, and Other Providers v2.0.0
2.0.2 2.0.1 2.0.0 1.9.5 trunk 0.0.4 0.0.5 0.0.6 1.0.0 1.0.1 1.1.0 1.2.0 1.3.0 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.6.2 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 All 31 releases
suremails / src / api / auth.js

auth.js in SureMail – SMTP and Email Logs Plugin with Amazon SES, Postmark, and Other Providers 2.0.0, at src/api/auth.js

33 lines 641 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import apiFetch from '@wordpress/api-fetch';
2 import { __ } from '@wordpress/i18n';
3
4 export const get_auth_url = async (
5 provider,
6 client_id,
7 client_secret,
8 redirect_url
9 ) => {
10 try {
11 const response = await apiFetch( {
12 path: '/suremails/v1/get-auth-url',
13 method: 'POST',
14 headers: {
15 'X-WP-Nonce': suremails.nonce,
16 'Content-Type': 'application/json',
17 },
18 body: JSON.stringify( {
19 provider,
20 client_id,
21 client_secret,
22 redirect_url,
23 } ),
24 } );
25 return response;
26 } catch ( error ) {
27 throw new Error(
28 error.message ||
29 __( 'There was an issue getting the auth URL.', 'suremails' )
30 );
31 }
32 };
33