fix: password confirmation

This commit is contained in:
Andras Bacsai 2023-08-31 09:56:37 +02:00
parent 7ec560d4a2
commit 87dd819ae4
12 changed files with 21 additions and 17 deletions

View File

@ -27,7 +27,7 @@ public function waitlist() {
}
public function subscription()
{
if (!is_cloud()) {
if (!isCloud()) {
abort(404);
}
return view('subscription.index', [
@ -37,7 +37,7 @@ public function subscription()
public function license()
{
if (!is_cloud()) {
if (!isCloud()) {
abort(404);
}
return view('settings.license', [

View File

@ -12,7 +12,7 @@ class ServerController extends Controller
public function new_server()
{
if (!is_cloud()) {
if (!isCloud()) {
return view('server.create', [
'limit_reached' => false,
'private_keys' => PrivateKey::ownedByCurrentTeam()->get(),

View File

@ -53,7 +53,7 @@ public function mount()
}
}
public function welcome() {
if (is_cloud()) {
if (isCloud()) {
return $this->setServerType('remote');
}
$this->currentState = 'select-server-type';

View File

@ -37,7 +37,7 @@ class Change extends Component
public function mount()
{
if (is_cloud() && !isDev()) {
if (isCloud() && !isDev()) {
$this->webhook_endpoint = config('app.url');
} else {
$this->webhook_endpoint = $this->ipv4;

View File

@ -13,7 +13,7 @@ public function handle(Request $request, Closure $next): Response
if (isInstanceAdmin()) {
return $next($request);
}
if (!auth()->user() || !is_cloud()) {
if (!auth()->user() || !isCloud()) {
if ($request->path() === 'subscription') {
return redirect('/');
} else {

View File

@ -217,7 +217,7 @@ function isDev(): bool
return config('app.env') === 'local';
}
function is_cloud(): bool
function isCloud(): bool
{
return !config('coolify.self_hosted');
}

View File

@ -8,7 +8,7 @@
<div class="w-96">
<form action="/user/confirm-password" method="POST" class="flex flex-col gap-2">
@csrf
<x-forms.input required type="password" name="password " label="{{ __('input.password') }}"
<x-forms.input required type="password" name="password" label="{{ __('input.password') }}"
autofocus />
<x-forms.button type="submit">{{ __('auth.confirm_password') }}</x-forms.button>
</form>

View File

@ -6,7 +6,7 @@
href="{{ route('settings.configuration') }}">
<button>Configuration</button>
</a>
@if (is_cloud())
@if (isCloud())
<a class="{{ request()->routeIs('settings.license') ? 'text-white' : '' }}"
href="{{ route('settings.license') }}">
<button>Resale License</button>

View File

@ -1,7 +1,7 @@
<div>
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex items-center gap-2">
<h3>General</h3>
<h2>General</h2>
<x-forms.button type="submit" label="Save">Save</x-forms.button>
</div>
<div class="flex gap-2">

View File

@ -90,7 +90,7 @@
<h2>Register a GitHub App</h2>
<div class="pt-1 pb-2 ">You need to register a GitHub App before using this source.</div>
<div class="pt-2 pb-10">
@if (!is_cloud() || isDev())
@if (!isCloud() || isDev())
<div class="flex items-end gap-2">
<x-forms.select wire:model='webhook_endpoint' label="Webhook Endpoint"
helper="All Git webhooks will be sent to this endpoint. <br><br>If you would like to use domain instead of IP address, set your Coolify instance's FQDN in the Settings menu.">

View File

@ -11,7 +11,7 @@
manually.
</div>
<div class="flex flex-col gap-2">
<form action="/user/confirmed-two-factor-authentication" method="POST" class="flex items-end w-32 gap-2">
<form action="/user/confirmed-two-factor-authentication" method="POST" class="flex items-end gap-2">
@csrf
<x-forms.input type="number" id="code" label="One-time code" required />
<x-forms.button type="submit">Validate 2FA</x-forms.button>
@ -19,11 +19,11 @@
<div>
<div>{!! $request->user()->twoFactorQrCodeSvg() !!}</div>
<div x-data="{ showCode: false }" class="py-2">
<x-forms.button x-on:click="showCode = !showCode">Show secret key to manually
enter</x-forms.button>
<template x-if="showCode">
<div class="py-2 ">{!! decrypt($request->user()->two_factor_secret) !!}</div>
</template>
<x-forms.button x-on:click="showCode = !showCode">Show secret key to manually
enter</x-forms.button>
</div>
</div>
</div>
@ -43,7 +43,7 @@
</div>
@else
@if ($request->user()->two_factor_confirmed_at)
<div class=""> Two factor authentication is <span class="text-helper">enabled</span>.</div>
<div class="pb-4 "> Two factor authentication is <span class="text-helper">enabled</span>.</div>
<div class="flex gap-2">
<form action="/user/two-factor-authentication" method="POST">
@csrf
@ -69,11 +69,15 @@
</div>
@endif
@else
<div class="pb-2 ">Two factor authentication is <span class="text-helper">disabled</span>.</div>
<form action="/user/two-factor-authentication" method="POST">
@csrf
<x-forms.button type="submit">Configure 2FA</x-forms.button>
</form>
@endif
@endif
@if (session()->has('errors'))
<div class="text-error">
Something went wrong. Please try again.
</div>
@endif
</x-layout>

View File

@ -3,7 +3,7 @@
->user()
->currentTeam()" />
<livewire:team.form />
@if (is_cloud())
@if (isCloud())
<div class="pb-8">
<h2>Subscription</h2>
@if (data_get(currentTeam(),