| @@ -86,22 +86,21 @@ | ||
| 86 | 86 | * Get auth url |
| 87 | 87 | * |
| 88 | 88 | * @return string |
| 89 | 89 | */ |
| 90 | - public function get_auth_url( $state = '' ) { | |
| 91 | - $params = array( | |
| 92 | - 'client_id' => $this->client_id, | |
| 93 | - 'scope' => urlencode_deep( $this->auth_scope ), | |
| 94 | - 'redirect_uri' => $this->redirect_uri, | |
| 95 | - 'response_type' => 'code', | |
| 96 | - 'access_type' => 'offline', | |
| 90 | + public function get_auth_url() { | |
| 91 | + $auth_url = add_query_arg( | |
| 92 | + array( | |
| 93 | + 'client_id' => $this->client_id, | |
| 94 | + 'scope' => urlencode_deep( $this->auth_scope ), | |
| 95 | + 'redirect_uri' => $this->redirect_uri, | |
| 96 | + 'response_type' => 'code', | |
| 97 | + 'access_type' => 'offline', | |
| 98 | + | |
| 99 | + ), self::TIMETICS_AUTH_URL | |
| 97 | 100 | ); |
| 98 | 101 | |
| 99 | - if ( ! empty( $state ) ) { | |
| 100 | - $params['state'] = $state; | |
| 101 | - } | |
| 102 | - | |
| 103 | - return add_query_arg( $params, self::TIMETICS_AUTH_URL ); | |
| 102 | + return $auth_url; | |
| 104 | 103 | } |
| 105 | 104 | |
| 106 | 105 | /** |
| 107 | 106 | * Set google authentication configuration |