mirror of
https://github.com/fccview/cronmaster.git
synced 2025-12-30 17:38:08 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4beb7053f7 | ||
|
|
d26ce0e810 | ||
|
|
d6b6aff44e | ||
|
|
7954111d05 |
@@ -52,8 +52,13 @@ export const UserSwitcher = ({
|
||||
return (
|
||||
<div className={`relative ${className}`}>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={() => setIsOpen(!isOpen)}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setIsOpen(!isOpen);
|
||||
}}
|
||||
className="w-full justify-between"
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -67,8 +72,11 @@ export const UserSwitcher = ({
|
||||
<div className="absolute top-full left-0 right-0 mt-1 bg-background border border-border rounded-md shadow-lg z-50 max-h-48 overflow-y-auto">
|
||||
{users.map((user) => (
|
||||
<button
|
||||
type="button"
|
||||
key={user}
|
||||
onClick={() => {
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
onUserChange(user);
|
||||
setIsOpen(false);
|
||||
}}
|
||||
|
||||
@@ -56,16 +56,19 @@ export async function requireAuth(
|
||||
return null;
|
||||
}
|
||||
|
||||
const hasValidApiKey = validateApiKey(request);
|
||||
if (hasValidApiKey) {
|
||||
return null;
|
||||
const apiKey = process.env.API_KEY;
|
||||
if (apiKey) {
|
||||
const hasValidApiKey = validateApiKey(request);
|
||||
if (hasValidApiKey) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.DEBUGGER) {
|
||||
console.log("[API Auth] Unauthorized request:", {
|
||||
path: request.nextUrl.pathname,
|
||||
hasSession: hasValidSession,
|
||||
hasApiKey: hasValidApiKey,
|
||||
apiKeyConfigured: !!process.env.API_KEY,
|
||||
hasAuthHeader: !!request.headers.get("authorization"),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cronjob-manager",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
Reference in New Issue
Block a user