芝麻web文件管理V1.00
编辑当前文件:/home/elegucvf/public_html/src/actions/wincher/wincher-login-action.php
client = $client; $this->options_helper = $options_helper; } /** * Returns the authorization URL. * * @return object The response object. */ public function get_authorization_url() { return (object) [ 'status' => 200, 'url' => $this->client->get_authorization_url(), ]; } /** * Authenticates with Wincher to request the necessary tokens. * * @param string $code The authentication code to use to request a token with. * @param string $website_id The website id associated with the code. * * @return object The response object. */ public function authenticate( $code, $website_id ) { // Code has already been validated at this point. No need to do that again. try { $tokens = $this->client->request_tokens( $code ); $this->options_helper->set( 'wincher_website_id', $website_id ); return (object) [ 'tokens' => $tokens->to_array(), 'status' => 200, ]; } catch ( Authentication_Failed_Exception $e ) { return $e->get_response(); } } }