Skip to content

Commit 3d8a954

Browse files
committed
Issue a token in the implicit flow
1 parent d95973f commit 3d8a954

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

inc/types/class-implicit.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ protected function handle_authorization_submission( $submit, Client $client, $da
1212

1313
switch ( $submit ) {
1414
case 'authorize':
15-
// Generate authorization code and redirect back.
16-
$code = 'x';
15+
// Generate token and redirect back.
16+
$user = wp_get_current_user();
17+
$token = $client->issue_token( $user );
18+
if ( is_wp_error( $token ) ) {
19+
return $token;
20+
}
21+
1722
$redirect_args = array(
18-
'code' => $code,
23+
'access_token' => $token->get_key(),
24+
'token_type' => 'bearer',
1925
);
2026
break;
2127

0 commit comments

Comments
 (0)