Compare commits
No commits in common. "bfdbf6dedc79089803c05898880539433d6c9c99" and "8031ed1892faf87517f6d7c9721f567bd87f319e" have entirely different histories.
bfdbf6dedc
...
8031ed1892
23
backend/.gitignore
vendored
23
backend/.gitignore
vendored
|
|
@ -1,23 +0,0 @@
|
|||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
const passport = require('passport');
|
||||
const LocalStrategy = require('passport-local').Strategy;
|
||||
|
||||
// Replace this with actual user verification logic
|
||||
const verifyCallback = (username, password, done) => {
|
||||
if (username === 'admin' && password === 'password') {
|
||||
return done(null, { id: 1, username: 'admin' });
|
||||
} else {
|
||||
return done(null, false, { message: 'Invalid credentials' });
|
||||
}
|
||||
};
|
||||
|
||||
passport.use(new LocalStrategy(verifyCallback));
|
||||
passport.serializeUser((user, done) => done(null, user.id));
|
||||
passport.deserializeUser((id, done) => done(null, { id, username: 'admin' }));
|
||||
1134
backend/package-lock.json
generated
1134
backend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"name": "backend",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"dockerode": "^4.0.2",
|
||||
"express": "^4.19.2",
|
||||
"express-session": "^1.18.0",
|
||||
"passport": "^0.7.0",
|
||||
"passport-local": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
// backend/server.js
|
||||
const express = require('express');
|
||||
const session = require('express-session');
|
||||
const passport = require('passport');
|
||||
const authRoutes = require('./routes/authRoutes');
|
||||
|
||||
const app = express();
|
||||
app.use(express.json());
|
||||
app.use(session({ secret: 'your_secret', resave: false, saveUninitialized: false }));
|
||||
app.use(passport.initialize());
|
||||
app.use(passport.session());
|
||||
|
||||
app.use('/api/auth', authRoutes);
|
||||
|
||||
app.listen(3001, () => {
|
||||
console.log('Backend server running on port 3001');
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user