REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.15 KB
Close
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/@adminjs/express/examples/auth.ts
Text
Base64
import MongooseAdapter from "@adminjs/mongoose"; import AdminJS from "adminjs"; import express from "express"; import mongoose from "mongoose"; import AdminJSExpress from "../src/index.js"; import "./mongoose/admin-model.js"; import "./mongoose/article-model.js"; AdminJS.registerAdapter(MongooseAdapter); const ADMIN = { email: "test@example.com", password: "password", }; const start = async () => { const connection = await mongoose.connect( process.env.MONGO_URL || "mongodb://localhost:27017/example" ); const app = express(); const adminJs = new AdminJS({ databases: [connection], rootPath: "/admin", }); const router = AdminJSExpress.buildAuthenticatedRouter(adminJs, { authenticate: async (email, password) => { if (ADMIN.password === password && ADMIN.email === email) { return ADMIN; } return null; }, cookiePassword: "somasd1nda0asssjsdhb21uy3g", maxRetries: { count: 3, duration: 120, }, }); app.use(adminJs.options.rootPath, router); app.listen(process.env.PORT || 8080, () => console.log("AdminJS is running under localhost:8080/admin") ); }; start();
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 2
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
mongoose
DIR
-
drwxr-xr-x
2026-02-28 00:28:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
auth.ts
1.15 KB
lrw-r--r--
2026-02-28 00:28:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
simple.ts
798 B
lrw-r--r--
2026-02-28 00:29:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).