fix: two factor

This commit is contained in:
Andras Bacsai 2024-03-25 14:23:32 +01:00
parent c9160cabc5
commit 37333f7fbe
8 changed files with 18 additions and 138 deletions

View File

@ -41,7 +41,6 @@
"stripe/stripe-php": "^12.0",
"symfony/yaml": "^6.2",
"visus/cuid2": "^2.0.0",
"wire-elements/modal": "^2.0",
"yosymfony/toml": "^1.0"
},
"require-dev": {

60
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9bdaf702cdd870434444f8937a816fdb",
"content-hash": "e095b8a9eb22df2943cbc3e9649ff9e8",
"packages": [
{
"name": "amphp/amp",
@ -11859,64 +11859,6 @@
},
"time": "2022-06-03T18:03:27+00:00"
},
{
"name": "wire-elements/modal",
"version": "2.0.9",
"source": {
"type": "git",
"url": "https://github.com/wire-elements/modal.git",
"reference": "899b05e313403669aa8a359db71a066246184355"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/wire-elements/modal/zipball/899b05e313403669aa8a359db71a066246184355",
"reference": "899b05e313403669aa8a359db71a066246184355",
"shasum": ""
},
"require": {
"livewire/livewire": "^3.2.3",
"php": "^8.1",
"spatie/laravel-package-tools": "^1.9"
},
"require-dev": {
"orchestra/testbench": "^8.5",
"phpunit/phpunit": "^9.5"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"LivewireUI\\Modal\\LivewireModalServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"LivewireUI\\Modal\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Philo Hermans",
"email": "me@philohermans.com"
}
],
"description": "Laravel Livewire modal component",
"keywords": [
"laravel",
"livewire",
"modal"
],
"support": {
"issues": "https://github.com/wire-elements/modal/issues",
"source": "https://github.com/wire-elements/modal/tree/2.0.9"
},
"time": "2023-12-08T09:31:14+00:00"
},
{
"name": "yosymfony/parser-utils",
"version": "v2.0.0",

View File

@ -1,52 +0,0 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Include CSS
|--------------------------------------------------------------------------
|
| The modal uses TailwindCSS, if you don't use TailwindCSS you will need
| to set this parameter to true. This includes the modern-normalize css.
|
*/
'include_css' => false,
/*
|--------------------------------------------------------------------------
| Include JS
|--------------------------------------------------------------------------
|
| Livewire UI will inject the required Javascript in your blade template.
| If you want to bundle the required Javascript you can set this to false
| and add `require('vendor/wire-elements/modal/resources/js/modal');`
| to your script bundler like webpack.
|
*/
'include_js' => false,
/*
|--------------------------------------------------------------------------
| Modal Component Defaults
|--------------------------------------------------------------------------
|
| Configure the default properties for a modal component.
|
| Supported modal_max_width
| 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl', '6xl', '7xl'
*/
'component_defaults' => [
'modal_max_width' => '7xl',
'close_modal_on_click_away' => true,
'close_modal_on_escape' => true,
'close_modal_on_escape_is_forceful' => true,
'dispatch_close_event' => false,
'destroy_on_close' => false,
],
];

View File

@ -1,6 +1,5 @@
import { createApp } from "vue";
import MagicBar from "./components/MagicBar.vue";
import "../../vendor/wire-elements/modal/resources/js/modal";
const app = createApp({});
app.component("magic-bar", MagicBar);

View File

@ -3,31 +3,25 @@
<div>
<div class="flex flex-col items-center pb-8">
<div class="text-5xl font-bold tracking-tight text-center dark:text-white">Coolify</div>
<x-version />
{{-- <x-version /> --}}
</div>
<div class="w-96" x-data="{ showRecovery: false }">
<div class="w-96">
<form action="/two-factor-challenge" method="POST" class="flex flex-col gap-2">
@csrf
<template x-if="!showRecovery">
<div>
<x-forms.input required type="number" name="code" label="{{ __('input.code') }}"
autofocus />
<div class="pt-2 text-xs cursor-pointer hover:underline hover:dark:text-white"
x-on:click="showRecovery = !showRecovery">Use
Recovery Code
</div>
<div>
<x-forms.input autofocus type="number" name="code" label="{{ __('input.code') }}" autofocus />
{{-- <div class="pt-2 text-xs cursor-pointer hover:underline hover:dark:text-white"
x-on:click="showRecovery = !showRecovery">Use
Recovery Code
</div> --}}
</div>
<div>
<x-forms.input name="recovery_code" label="{{ __('input.recovery_code') }}" />
<div class="pt-2 text-xs cursor-pointer hover:underline hover:dark:text-white"
x-on:click="showRecovery = !showRecovery">Use
One-Time Code
</div>
</template>
<template x-if="showRecovery">
<div>
<x-forms.input required type="text" name="recovery_code"
label="{{ __('input.recovery_code') }}" />
<div class="pt-2 text-xs cursor-pointer hover:underline hover:dark:text-white"
x-on:click="showRecovery = !showRecovery">Use
One-Time Code
</div>
</div>
</template>
</div>
<x-forms.button type="submit">{{ __('auth.login') }}</x-forms.button>
</form>
@if ($errors->any())

View File

@ -38,7 +38,6 @@
@section('body')
<body>
{{-- @livewire('wire-elements-modal') --}}
<x-toast />
<script data-navigate-once>
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia(

View File

@ -1,7 +1,7 @@
@extends('layouts.base')
@section('body')
@parent
<main>
<main class="h-full bg-gray-50 dark:bg-base">
{{ $slot }}
</main>
@parent
@endsection

View File

@ -15,7 +15,6 @@ const colors = {
module.exports = {
darkMode: "selector",
content: [
'./vendor/wire-elements/modal/resources/views/*.blade.php',
'./storage/framework/views/*.php',
"./resources/**/*.blade.php",
"./app/**/*.php",