mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-02-03 02:10:45 +00:00
Updaet AppRegisterController, add client id/secret
This commit is contained in:
parent
fe46512359
commit
f924491e4d
1 changed files with 4 additions and 0 deletions
|
@ -164,6 +164,8 @@ class AppRegisterController extends Controller
|
||||||
|
|
||||||
$token = $user->createToken('Pixelfed App', ['read', 'write', 'follow', 'push']);
|
$token = $user->createToken('Pixelfed App', ['read', 'write', 'follow', 'push']);
|
||||||
$tokenModel = $token->token;
|
$tokenModel = $token->token;
|
||||||
|
$clientId = $tokenModel->client_id;
|
||||||
|
$clientSecret = DB::table('oauth_clients')->where('id', $clientId)->value('secret');
|
||||||
$refreshTokenRepo = app(RefreshTokenRepository::class);
|
$refreshTokenRepo = app(RefreshTokenRepository::class);
|
||||||
$refreshToken = $refreshTokenRepo->create([
|
$refreshToken = $refreshTokenRepo->create([
|
||||||
'id' => Str::random(80),
|
'id' => Str::random(80),
|
||||||
|
@ -182,6 +184,8 @@ class AppRegisterController extends Controller
|
||||||
'expires_in' => $expiresIn,
|
'expires_in' => $expiresIn,
|
||||||
'access_token' => $token->accessToken,
|
'access_token' => $token->accessToken,
|
||||||
'refresh_token' => $refreshToken->id,
|
'refresh_token' => $refreshToken->id,
|
||||||
|
'client_id' => $clientId,
|
||||||
|
'client_secret' => $clientSecret,
|
||||||
'scope' => ['read', 'write', 'follow', 'push'],
|
'scope' => ['read', 'write', 'follow', 'push'],
|
||||||
'user' => [
|
'user' => [
|
||||||
'pid' => (string) $user->profile_id,
|
'pid' => (string) $user->profile_id,
|
||||||
|
|
Loading…
Reference in a new issue