Skip to content

Commit

Permalink
oauth locale
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Mar 14, 2024
1 parent 79208b0 commit 38ff708
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http;

use App\Http\Middleware\Locale;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
Expand Down Expand Up @@ -38,6 +39,7 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
Locale::class,
],

'api' => [
Expand Down
2 changes: 1 addition & 1 deletion include/constants.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.9');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-03-11');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-03-15');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
Expand Down
Binary file added public/pic/oauth2-authorize-bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions resources/lang/en/oauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
'revoked' => 'Valid',
'access_token' => 'Access token',
'refresh_token' => 'Refresh token',
'authorization_request_title' => 'Authorization Request',
'authorization_request_desc' => 'is requesting permission to access your account',
'btn_approve' => 'Authorize',
'btn_deny' => 'Cancel',
];
4 changes: 4 additions & 0 deletions resources/lang/zh_CN/oauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
'revoked' => '有效',
'access_token' => '访问令牌',
'refresh_token' => '刷新令牌',
'authorization_request_title' => '授权请求',
'authorization_request_desc' => '正在请求获取您账号的访问权限',
'btn_approve' => '授权',
'btn_deny' => '取消',
];
16 changes: 9 additions & 7 deletions resources/views/vendor/passport/authorize.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@
justify-content: center;
align-items: center;
height: 100vh;
background-image: url("/pic/oauth2-authorize-bg.jpg");
}
.passport-authorize .card {
/*padding: 40px;*/
padding: 40px;
background-color: #ffffff;
}
.passport-authorize .card-header {
font-size: 24px;
font-size: 36px;
text-align: center;
margin-bottom: 20px;
margin-bottom: 15px;
}
.passport-authorize .scopes {
Expand Down Expand Up @@ -61,11 +63,11 @@
<body class="passport-authorize">
<div class="card card-default">
<div class="card-header">
Authorization Request
{{ __('oauth.authorization_request_title') }}
</div>
<div class="card-body">
<!-- Introduction -->
<p><strong>{{ $client->name }}</strong> is requesting permission to access your account.</p>
<p><strong>{{ $client->name }}</strong> {{ __('oauth.authorization_request_desc') }}.</p>

<!-- Scope List -->
@if (count($scopes) > 0)
Expand All @@ -88,7 +90,7 @@
<input type="hidden" name="state" value="{{ $request->state }}">
<input type="hidden" name="client_id" value="{{ $client->getKey() }}">
<input type="hidden" name="auth_token" value="{{ $authToken }}">
<button type="submit" class="btn btn-success btn-approve">Authorize</button>
<button type="submit" class="btn btn-success btn-approve">{{ __('oauth.btn_approve') }}</button>
</form>

<!-- Cancel Button -->
Expand All @@ -99,7 +101,7 @@
<input type="hidden" name="state" value="{{ $request->state }}">
<input type="hidden" name="client_id" value="{{ $client->getKey() }}">
<input type="hidden" name="auth_token" value="{{ $authToken }}">
<button class="btn btn-danger">Cancel</button>
<button class="btn btn-danger">{{ __('oauth.btn_deny') }}</button>
</form>
</div>
</div>
Expand Down

0 comments on commit 38ff708

Please sign in to comment.