|
9 | 9 | class Auth extends Service |
10 | 10 | { |
11 | 11 | /** |
12 | | - * Login User |
| 12 | + * Login |
13 | 13 | * |
14 | 14 | * Allow the user to login into his account by providing a valid email and |
15 | 15 | * password combination. Use the success and failure arguments to provide a |
@@ -48,6 +48,28 @@ public function login(string $email, string $password, string $success = '', str |
48 | 48 | ], $params); |
49 | 49 | } |
50 | 50 |
|
| 51 | + /** |
| 52 | + * Login with OAuth |
| 53 | + * |
| 54 | + * @param string $provider |
| 55 | + * @param string $success |
| 56 | + * @param string $failure |
| 57 | + * @throws Exception |
| 58 | + * @return array |
| 59 | + */ |
| 60 | + public function oauth(string $provider, string $success, string $failure):array |
| 61 | + { |
| 62 | + $path = str_replace(['{provider}'], [$provider], '/auth/login/oauth/{provider}'); |
| 63 | + $params = []; |
| 64 | + |
| 65 | + $params['success'] = $success; |
| 66 | + $params['failure'] = $failure; |
| 67 | + |
| 68 | + return $this->client->call(Client::METHOD_GET, $path, [ |
| 69 | + 'content-type' => 'application/json', |
| 70 | + ], $params); |
| 71 | + } |
| 72 | + |
51 | 73 | /** |
52 | 74 | * Logout Current Session |
53 | 75 | * |
@@ -91,28 +113,6 @@ public function logoutBySession(string $id):array |
91 | 113 | ], $params); |
92 | 114 | } |
93 | 115 |
|
94 | | - /** |
95 | | - * OAuth Login |
96 | | - * |
97 | | - * @param string $provider |
98 | | - * @param string $success |
99 | | - * @param string $failure |
100 | | - * @throws Exception |
101 | | - * @return array |
102 | | - */ |
103 | | - public function oauth(string $provider, string $success, string $failure):array |
104 | | - { |
105 | | - $path = str_replace(['{provider}'], [$provider], '/auth/oauth/{provider}'); |
106 | | - $params = []; |
107 | | - |
108 | | - $params['success'] = $success; |
109 | | - $params['failure'] = $failure; |
110 | | - |
111 | | - return $this->client->call(Client::METHOD_GET, $path, [ |
112 | | - 'content-type' => 'application/json', |
113 | | - ], $params); |
114 | | - } |
115 | | - |
116 | 116 | /** |
117 | 117 | * Password Recovery |
118 | 118 | * |
@@ -177,7 +177,7 @@ public function recoveryReset(string $userId, string $token, string $passwordA, |
177 | 177 | } |
178 | 178 |
|
179 | 179 | /** |
180 | | - * Register User |
| 180 | + * Register |
181 | 181 | * |
182 | 182 | * Use this endpoint to allow a new user to register an account in your |
183 | 183 | * project. Use the success and failure URLs to redirect users back to your |
@@ -227,7 +227,7 @@ public function register(string $email, string $password, string $confirm, strin |
227 | 227 | } |
228 | 228 |
|
229 | 229 | /** |
230 | | - * Confirm User |
| 230 | + * Confirmation |
231 | 231 | * |
232 | 232 | * Use this endpoint to complete the confirmation of the user account email |
233 | 233 | * address. Both the **userId** and **token** arguments will be passed as |
|
0 commit comments