Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
2022-10-24 01:01:10 +01:00
parent 614410e7b7
commit 0bc6c20a6d
166 changed files with 4250 additions and 1833 deletions

View File

@@ -33,7 +33,7 @@
<p>{{ __('Deleting your account is an irreversible process. The following data will be deleted (including personally identifiable data):') }}</p>
<ul>
<li>{{ __('Last IP address') }}</li>
<li>{{ __('Name, Email and MC Username') }}</li>
<li>{{ __('Your name and email address') }}</li>
<li>{{ __('Your previous applications') }}</li>
<li>{{ __('Your profile data and preferences') }}</li>
<li>{{ __('Any other information stored in your user profile') }}</li>
@@ -60,21 +60,14 @@
@csrf
@method('PATCH')
<div class="form-group">
<label for="currentPassword">{{ __('Re-enter your password') }}</label>
<input class="form-control" autocomplete="current-password" type="password" name="currentPassword" id="currentPassword" required>
<p class="text-muted text-sm"><i class="fas fa-info-circle"></i> {{ __('For your security, your password is always required for sensitive operations.') }} <a href="{{ route('password.request') }}">{{ __('Forgot your password?') }}</a></p>
</div>
<x-confirm-password>
{{ __('For your security, your password is always required for sensitive operations.') }}
</x-confirm-password>
@if (Auth::user()->has2FA())
<div class="form-group mt-5">
<x-confirm-second-factor>
{{ __('You cannot recover lost 2FA secrets.') }}
</x-confirm-second-factor>
<label for="otp">{{ __('Two-factor authentication code') }}</label>
<input type="text" id="otp" name="otp" class="form-control">
<p class="text-muted text-sm"><i class="fas fa-info-circle"></i> {{ __('You cannot recover lost 2FA secrets.') }}</p>
</div>
@endif
</form>
@@ -247,6 +240,9 @@
<li class="nav-item">
<a class="nav-link" id="accountSecurityTab" data-toggle="tab" href="#accountSecurity" role="tab" aria-controls="AccountSecurity" aria-selected="true">{{__('Account Security')}}</a>
</li>
<li class="nav-item">
<a class="nav-link" id="connectedAccountsTab" data-toggle="tab" href="#connectedAccounts" role="tab" aria-controls="ConnectedAccounts" aria-selected="false">{{__('Connected Accounts')}}</a>
</li>
<li class="nav-item">
<a class="nav-link" id="twofaTab" data-toggle="tab" href="#twofa" role="tab" aria-controls="TwoFa" aria-selected="false">{{__('Two Factor Authentication')}}</a>
</li>
@@ -270,30 +266,102 @@
</div>
@endif
<h5 class="card-title">{{__('Change Password')}}</h5>
<p class="card-text">{{__('Change your password here. This will log you out from all existing sessions for your security.')}}</p>
@if (!Auth::user()->hasPassword())
<form method="POST" action="{{route('changePassword')}}" id="changePassword">
<h5>{{ __('Your :appName account does not have a password', ['appName' => config('app.name')]) }}</h5>
@csrf
@method('PATCH')
<label for="oldpassword">{{__('Old Password')}}</label>
<input class="form-control" name="oldPassword" type="password" id="oldpassword" autocomplete="current-password">
<p class="text-sm text-muted">{!! __('Forgot password? Reset it <a href="/auth/password/reset">here</a>!') !!}</p>
<p>{!! __('Because your account is linked to one or more <a href=":oAuthExplanationLink" target="_blank">OAuth</a> providers (such as Discord), there is no need for your account to use a password.', ['oAuthExplanationLink' => 'https://en.wikipedia.org/wiki/OAuth']) !!}</p>
<p>{{ __('Because several sensitive actions on the app require you to confirm your password, you may define one below. This will also allow you to unlink your accounts and login with a password.') }}</p>
<div class="form-group mt-5">
<form method="POST" action="{{ route('addPassword') }}" id="setPassword">
@csrf
@method('PATCH')
<label for="newpassword">{{__('New Password')}}</label>
<input type="password" name="newPassword" id="newpassword" class="form-control" autocomplete="new-password">
<p class="text-bold"><i class="fas fa-key"></i> {{ __('Setting a new password:') }}</p>
<label for="newpassword_confirmation">{{__('Confirm Password')}}</label>
<input type="password" name="newPassword_confirmation" id="newpassword_confirmation" autocomplete="new-password" class="form-control">
<div class="row">
<div class="col">
<label for="unlinkNewPassword">{{ __('New password') }}</label>
<input type="password" name="newpass" id="unlinkNewPassword" class="form-control">
</div>
<div class="col">
<label for="unlinkConfirmNewPassword">{{ __('Confirm new password') }}</label>
<input type="password" name="newpass_confirmation" if="unlinkConfirmNewPassword" class="form-control">
</div>
</div>
<input type="hidden" name="dc" value="false">
<button type="submit" class="btn btn-warning btn-md mt-4"><i class="fas fa-check"></i> {{ __('Set password') }}</button>
<p class="text-sm"><i>{{ __('You will be logged out afterwards.') }}</i></p>
</form>
@else
<h5 class="card-title">{{__('Change Password')}}</h5>
<p class="card-text">{{__('Change your password here. This will log you out from all existing sessions for your security.')}}</p>
<form method="POST" action="{{route('changePassword')}}" id="changePassword">
@csrf
@method('PATCH')
<label for="oldpassword">{{__('Old Password')}}</label>
<input class="form-control" name="oldPassword" type="password" id="oldpassword" autocomplete="current-password">
<p class="text-sm text-muted">{!! __('Forgot password? Reset it <a href="/auth/password/reset">here</a>!') !!}</p>
<div class="form-group mt-5">
<label for="newpassword">{{__('New Password')}}</label>
<input type="password" name="newPassword" id="newpassword" class="form-control" autocomplete="new-password">
<label for="newpassword_confirmation">{{__('Confirm Password')}}</label>
<input type="password" name="newPassword_confirmation" id="newpassword_confirmation" autocomplete="new-password" class="form-control">
</div>
</form>
<button {{ ($demoActive) ? 'disabled' : '' }} class="btn btn-success" type="button" onclick="document.getElementById('changePassword').submit()">{{__('Change Password')}}</button>
@endif
</div>
<div class="tab-pane fade p-3" id="connectedAccounts" role="tabpanel" aria-labelledby="connectedAccountsTab">
<h5 class="card-title">{{ __('Connected Accounts') }}</h5>
<p class="card-text">{{__('Manage your connected external accounts here.')}}</p>
@if(Auth::user()->hasDiscordConnection())
<p class="text-muted">{{ __('Your account is currently connected to Discord.') }}</p>
@if(!Auth::user()->hasPassword())
<x-alert icon="fas fa-exclamation-triangle" alert-type="warning" title="{{ __('Account unlinking disabled') }}">
{{ __("We've disabled unlinking your Discord account for now. To re-enable it, please add a password in the Account Security screen. This is to ensure you still have access to your account even after you change your Discord account email address.") }}
</x-alert>
@else
<x-alert icon="fas fa-info-circle" alert-type="info" title="{{ __('Note on disconnecting accounts') }}">
<p>{{ __("If you choose to disconnect your Discord account, we'll let Discord know by revoking your authorization. This means you will no longer be able to apply for positions that require a linked Discord account, and you may also lose any server privileges/roles that may have been granted through your linked account.") }}</p>
<p>{{ __(" You'll be able to link your account again through this page or by signing in with Discord again, but remember that if you changed your Discord email address, you will no longer have access to your old account.") }}</p>
</x-alert>
@endif
<div class="row mt-2">
<div class="col">
<x-button id="discordConnected" type="button" icon="fab fa-discord" color="primary" disabled> {{ __('Connected to Discord') }}</x-button>
</div>
<div class="col-9">
@if(Auth::user()->hasPassword())
<form name="disconnectAccount" method="post" action="{{ route('unlink-discord-account') }}">
@method('PATCH')
@csrf
<x-button id="discordDisconnect" type="submit" icon="fas fa-unlink" color="danger">{{ __('Disconnect') }}</x-button>
</form>
@else
<x-button id="discordDisconnect" type="button" icon="fas fa-unlink" color="danger" disabled>{{ __('Disconnect') }}</x-button>
@endif
</div>
</div>
@else
<p class="text-muted">{{ __('Your Discord account is not connected. Connect your Discord account below in order to apply for positions that require it.') }}</p>
<x-button id="discordDisconnected" type="button" icon="fab fa-discord" color="primary" link="{{ route('discordRedirect') }}"> {{ __('Connect to Discord') }}</x-button>
@endif
</form>
<button {{ ($demoActive) ? 'disabled' : '' }} class="btn btn-success" type="button" onclick="document.getElementById('changePassword').submit()">{{__('Change Password')}}</button>
</div>
<div class="tab-pane fade p-3" id="twofa" role="tabpanel" aria-labelledby="twofaTab">
<h5 class="card-title">{{__('Two Factor Authentication')}}</h5>