mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
reworked admin auth to use form and cookie + adjusted oauth to support API and cookie-based auth
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
import { MantineProvider } from "@mantine/core";
|
||||
import { Notifications } from "@mantine/notifications";
|
||||
import React from "react";
|
||||
import { FlashMessage } from "ui/modules/server/FlashMessage";
|
||||
import { BkndProvider, ClientProvider, useBknd } from "./client";
|
||||
import { createMantineTheme } from "./lib/mantine/theme";
|
||||
import { BkndModalsProvider } from "./modals";
|
||||
import { Routes } from "./routes";
|
||||
|
||||
export default function Admin({
|
||||
baseUrl: baseUrlOverride,
|
||||
withProvider = false
|
||||
}: { baseUrl?: string; withProvider?: boolean }) {
|
||||
export type BkndAdminProps = {
|
||||
baseUrl?: string;
|
||||
withProvider?: boolean;
|
||||
// @todo: add admin config override
|
||||
};
|
||||
|
||||
export default function Admin({ baseUrl: baseUrlOverride, withProvider = false }: BkndAdminProps) {
|
||||
const Component = (
|
||||
<BkndProvider>
|
||||
<AdminInternal />
|
||||
@@ -25,9 +29,11 @@ export default function Admin({
|
||||
function AdminInternal() {
|
||||
const b = useBknd();
|
||||
const theme = b.app.getAdminConfig().color_scheme;
|
||||
|
||||
return (
|
||||
<MantineProvider {...createMantineTheme(theme ?? "light")}>
|
||||
<Notifications />
|
||||
<FlashMessage />
|
||||
<BkndModalsProvider>
|
||||
<Routes />
|
||||
</BkndModalsProvider>
|
||||
|
||||
Reference in New Issue
Block a user