mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
Feature: Auth (#4)
* feat(api): add auth * feat(web): add auth and refactor * refactor(web): baseurl * feat: add autobrrctl cli for user creation * build: move static assets * refactor(web): auth guard and routing * refactor: rename var * fix: remove subrouter * build: update default config
This commit is contained in:
parent
2e8d0950c1
commit
40b855bf39
56 changed files with 1208 additions and 257 deletions
|
@ -41,77 +41,77 @@ export default function Base() {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* <div className="hidden md:block">*/}
|
||||
{/* <div className="ml-4 flex items-center md:ml-6">*/}
|
||||
{/* <button*/}
|
||||
{/* className="bg-gray-800 p-1 text-gray-400 rounded-full hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white">*/}
|
||||
{/* <span className="sr-only">View notifications</span>*/}
|
||||
{/* <BellIcon className="h-6 w-6" aria-hidden="true"/>*/}
|
||||
{/* </button>*/}
|
||||
<div className="hidden md:block">
|
||||
<div className="ml-4 flex items-center md:ml-6">
|
||||
{/*<button*/}
|
||||
{/* className="bg-gray-800 p-1 text-gray-400 rounded-full hover:text-white focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white">*/}
|
||||
{/* <span className="sr-only">View notifications</span>*/}
|
||||
{/* <BellIcon className="h-6 w-6" aria-hidden="true"/>*/}
|
||||
{/*</button>*/}
|
||||
|
||||
{/* <Menu as="div" className="ml-3 relative">*/}
|
||||
{/* {({open}) => (*/}
|
||||
{/* <>*/}
|
||||
{/* <div>*/}
|
||||
{/* <Menu.Button*/}
|
||||
{/* className="max-w-xs bg-gray-800 rounded-full flex items-center text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white">*/}
|
||||
{/* <span*/}
|
||||
{/* className="hidden text-gray-300 text-sm font-medium lg:block">*/}
|
||||
{/* <span className="sr-only">Open user menu for </span>User*/}
|
||||
{/*</span>*/}
|
||||
{/* <ChevronDownIcon*/}
|
||||
{/* className="hidden flex-shrink-0 ml-1 h-5 w-5 text-gray-400 lg:block"*/}
|
||||
{/* aria-hidden="true"*/}
|
||||
{/* />*/}
|
||||
{/* </Menu.Button>*/}
|
||||
{/* </div>*/}
|
||||
{/* <Transition*/}
|
||||
{/* show={open}*/}
|
||||
{/* as={Fragment}*/}
|
||||
{/* enter="transition ease-out duration-100"*/}
|
||||
{/* enterFrom="transform opacity-0 scale-95"*/}
|
||||
{/* enterTo="transform opacity-100 scale-100"*/}
|
||||
{/* leave="transition ease-in duration-75"*/}
|
||||
{/* leaveFrom="transform opacity-100 scale-100"*/}
|
||||
{/* leaveTo="transform opacity-0 scale-95"*/}
|
||||
{/* >*/}
|
||||
{/* <Menu.Items*/}
|
||||
{/* static*/}
|
||||
{/* className="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"*/}
|
||||
{/* >*/}
|
||||
{/* <Menu.Item>*/}
|
||||
{/* {({active}) => (*/}
|
||||
{/* <Link*/}
|
||||
{/* to="settings"*/}
|
||||
{/* className={classNames(*/}
|
||||
{/* active ? 'bg-gray-100' : '',*/}
|
||||
{/* 'block px-4 py-2 text-sm text-gray-700'*/}
|
||||
{/* )}*/}
|
||||
{/* >*/}
|
||||
{/* Settings*/}
|
||||
{/* </Link>*/}
|
||||
{/* )}*/}
|
||||
{/* </Menu.Item>*/}
|
||||
{/* <Menu.Item>*/}
|
||||
{/* {({active}) => (*/}
|
||||
{/* <Link*/}
|
||||
{/* to="logout"*/}
|
||||
{/* className={classNames(*/}
|
||||
{/* active ? 'bg-gray-100' : '',*/}
|
||||
{/* 'block px-4 py-2 text-sm text-gray-700'*/}
|
||||
{/* )}*/}
|
||||
{/* >*/}
|
||||
{/* Logout*/}
|
||||
{/* </Link>*/}
|
||||
{/* )}*/}
|
||||
{/* </Menu.Item>*/}
|
||||
{/* </Menu.Items>*/}
|
||||
{/* </Transition>*/}
|
||||
{/* </>*/}
|
||||
{/* )}*/}
|
||||
{/* </Menu>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
<Menu as="div" className="ml-3 relative">
|
||||
{({open}) => (
|
||||
<>
|
||||
<div>
|
||||
<Menu.Button
|
||||
className="max-w-xs bg-gray-800 rounded-full flex items-center text-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white">
|
||||
<span
|
||||
className="hidden text-gray-300 text-sm font-medium lg:block">
|
||||
<span className="sr-only">Open user menu for </span>User
|
||||
</span>
|
||||
<ChevronDownIcon
|
||||
className="hidden flex-shrink-0 ml-1 h-5 w-5 text-gray-400 lg:block"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</Menu.Button>
|
||||
</div>
|
||||
<Transition
|
||||
show={open}
|
||||
as={Fragment}
|
||||
enter="transition ease-out duration-100"
|
||||
enterFrom="transform opacity-0 scale-95"
|
||||
enterTo="transform opacity-100 scale-100"
|
||||
leave="transition ease-in duration-75"
|
||||
leaveFrom="transform opacity-100 scale-100"
|
||||
leaveTo="transform opacity-0 scale-95"
|
||||
>
|
||||
<Menu.Items
|
||||
static
|
||||
className="origin-top-right absolute right-0 mt-2 w-48 z-10 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"
|
||||
>
|
||||
<Menu.Item>
|
||||
{({active}) => (
|
||||
<Link
|
||||
to="settings"
|
||||
className={classNames(
|
||||
active ? 'bg-gray-100' : '',
|
||||
'block px-4 py-2 text-sm text-gray-700'
|
||||
)}
|
||||
>
|
||||
Settings
|
||||
</Link>
|
||||
)}
|
||||
</Menu.Item>
|
||||
<Menu.Item>
|
||||
{({active}) => (
|
||||
<Link
|
||||
to="/logout"
|
||||
className={classNames(
|
||||
active ? 'bg-gray-100' : '',
|
||||
'block px-4 py-2 text-sm text-gray-700'
|
||||
)}
|
||||
>
|
||||
Logout
|
||||
</Link>
|
||||
)}
|
||||
</Menu.Item>
|
||||
</Menu.Items>
|
||||
</Transition>
|
||||
</>
|
||||
)}
|
||||
</Menu>
|
||||
</div>
|
||||
</div>
|
||||
<div className="-mr-2 flex md:hidden">
|
||||
{/* Mobile menu button */}
|
||||
<Disclosure.Button
|
||||
|
@ -192,7 +192,7 @@ export default function Base() {
|
|||
<FilterDetails />
|
||||
</Route>
|
||||
|
||||
<Route path="/">
|
||||
<Route exact path="/">
|
||||
<Dashboard />
|
||||
</Route>
|
||||
</Switch>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue