diff --git a/.env.example b/.env.example
new file mode 100644
index 0000000..79b9d76
--- /dev/null
+++ b/.env.example
@@ -0,0 +1 @@
+LUCENT_AUTH=lucent // or lunar
diff --git a/front/js/svelte/files/Uploader.svelte b/front/js/svelte/files/Uploader.svelte
index 6394e25..ff76256 100644
--- a/front/js/svelte/files/Uploader.svelte
+++ b/front/js/svelte/files/Uploader.svelte
@@ -39,10 +39,6 @@
dispatch("uploadComplete", data);
}
isLoading = false;
- })
- .catch((error) => {
- isLoading = false;
- console.log(error);
});
}
diff --git a/front/js/svelte/layout/Header.svelte b/front/js/svelte/layout/Header.svelte
index 8513fc1..f54cfe5 100644
--- a/front/js/svelte/layout/Header.svelte
+++ b/front/js/svelte/layout/Header.svelte
@@ -8,8 +8,9 @@
diff --git a/front/js/svelte/layout/Navbar.svelte b/front/js/svelte/layout/Navbar.svelte
index 949cb9e..507f45e 100644
--- a/front/js/svelte/layout/Navbar.svelte
+++ b/front/js/svelte/layout/Navbar.svelte
@@ -1,39 +1,21 @@
+
diff --git a/front/js/svelte/records/elements/File.svelte b/front/js/svelte/records/elements/File.svelte
index 02a3c7f..10bb428 100644
--- a/front/js/svelte/records/elements/File.svelte
+++ b/front/js/svelte/records/elements/File.svelte
@@ -34,7 +34,7 @@
}
function uploadComplete(e) {
- records = e.detail;
+ // value = [...value, e.detail];
}
function openBrowseModal(e) {
diff --git a/src/Channel/Channel.php b/src/Channel/Channel.php
index a204476..087bb5a 100644
--- a/src/Channel/Channel.php
+++ b/src/Channel/Channel.php
@@ -4,7 +4,8 @@ namespace Lucent\Channel;
use Lucent\Channel\Data\UserCommand;
use Lucent\Primitive\Collection;
-use Lucent\Schema\Schema;
+use Lucent\Data\Schema;
+use Lucent\Data\ChannelAuth;
final class Channel
{
@@ -18,6 +19,7 @@ final class Channel
*/
function __construct(
public string $name,
+ public ChannelAuth $auth,
public string $url,
public string $previewTarget,
public Collection $commands,
@@ -27,7 +29,6 @@ final class Channel
) {
$this->lucentUrl = $url . "/lucent";
$this->filesUrl = $this->makeFilesUrl();
-
$this->previewTargetUrl = $url . "/" . $previewTarget;
}
diff --git a/src/Channel/ChannelService.php b/src/Channel/ChannelService.php
index f68806f..3939403 100644
--- a/src/Channel/ChannelService.php
+++ b/src/Channel/ChannelService.php
@@ -3,6 +3,7 @@
namespace Lucent\Channel;
use Lucent\Channel\Data\UserCommand;
+use Lucent\Data\ChannelAuth;
use Lucent\Primitive\Collection;
use Lucent\Data\Schema;
use Lucent\Schema\SchemaService;
@@ -34,6 +35,10 @@ final class ChannelService
$channel = new Channel(
name: config("lucent.name") ?? "",
+ auth: match (config("lucent.auth")) {
+ "lunar" => ChannelAuth::LUNAR,
+ default => ChannelAuth::LUCENT,
+ },
url: rtrim(config("lucent.url") ?? "", "/"),
previewTarget: rtrim(config("lucent.previewTarget") ?? "", "/"),
commands: Collection::make($userCommands),
diff --git a/src/Config/main.php b/src/Config/main.php
index 83af640..8e41f4d 100644
--- a/src/Config/main.php
+++ b/src/Config/main.php
@@ -2,10 +2,11 @@
return [
"env" => env("LUCENT_ENV", "production"),
+ "auth" => env("LUCENT_AUTH", "lucent"),
"schemas_path" => env("LUCENT_SCHEMAS_PATH", "resources/lucent/schemas"),
- "database" => env('LUCENT_DB_CONNECTION', env('DB_CONNECTION', "sqlite")),
+ "database" => env("LUCENT_DB_CONNECTION", env("DB_CONNECTION", "sqlite")),
"name" => env("LUCENT_NAME", "Lucent"),
- "url" => env("LUCENT_URL", env('APP_URL')),
+ "url" => env("LUCENT_URL", env("APP_URL")),
"previewTarget" => env("LUCENT_PREVIEW_TARGET", "previewTarget"),
/*
* Make available laravel artisan commands for admin users
@@ -44,6 +45,6 @@ return [
\Lucent\Schema\Ui\Rich::class,
\Lucent\Schema\Ui\Slug::class,
\Lucent\Schema\Ui\Text::class,
- \Lucent\Schema\Ui\Textarea::class
- ]
+ \Lucent\Schema\Ui\Textarea::class,
+ ],
];
diff --git a/src/Data/ChannelAuth.php b/src/Data/ChannelAuth.php
new file mode 100644
index 0000000..2ad2169
--- /dev/null
+++ b/src/Data/ChannelAuth.php
@@ -0,0 +1,9 @@
+app->bind(UserRepo::class, function () {
- return new UserRepoLunar();
+ $this->app->bind(UserRepo::class, function ($app) {
+ return match ($app->make(ChannelService::class)->channel->auth) {
+ ChannelAuth::LUNAR => new UserRepoLunar(),
+ ChannelAuth::LUCENT => new UserRepoLucent(),
+ };
});
$this->app->bind(AuthService::class, function ($app) {