| @@ -4,8 +4,9 @@ | ||
| 4 | 4 | |
| 5 | 5 | use WPDataAccess\Utilities\WPDA_Remote_Call; |
| 6 | 6 | use WPDataAccess\WPDA; |
| 7 | 7 | |
| 8 | +// phpcs:disable PluginCheck.CodeAnalysis.Offloading.OffloadedContent | |
| 8 | 9 | class WPDA_Google_Drive extends WPDA_Drive { |
| 9 | 10 | |
| 10 | 11 | const GOOGLE_CLIENT_ID = '400971594152-30c2ro61ohe4jbb2jt09n9q86itnkjvm.apps.googleusercontent.com'; |
| 11 | 12 | const GOOGLE_CLIENT_SECRET = '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'; |
| @@ -21,14 +22,8 @@ | ||
| 21 | 22 | |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | 25 | public function authorize( $authorization, $enabled = true ) { |
| 25 | - | |
| 26 | - // Link to authorization application (does not return a authorization code): | |
| 27 | - // Template | |
| 28 | - // https://accounts.google.com/o/oauth2/v2/auth?client_id=YOUR_CLIENT_ID&redirect_uri=GOOGLE_REDIRECT_URI&response_type=code&scope=https://www.googleapis.com/auth/drive.file%20https://www.googleapis.com/auth/drive.readonly&access_type=offline&prompt=consent | |
| 29 | - // Actual | |
| 30 | - // https://accounts.google.com/o/oauth2/v2/auth?client_id=400971594152-30c2ro61ohe4jbb2jt09n9q86itnkjvm.apps.googleusercontent.com&redirect_uri=http://localhost&response_type=code&scope=https://www.googleapis.com/auth/drive.file%20https://www.googleapis.com/auth/drive.readonly&access_type=offline&prompt=consent | |
| 31 | 26 | |
| 32 | 27 | // TODO: Get authorization code from reply |
| 33 | 28 | |
| 34 | 29 | $response = WPDA_Remote_Call::post( |