Skip to content

Commit 3605d73

Browse files
committed
fix: remove debug lines
1 parent 04c3878 commit 3605d73

File tree

6 files changed

+2
-20
lines changed

6 files changed

+2
-20
lines changed

src/service/passport/jwtAuthHandler.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const jwtAuthHandler = () => {
7272
}
7373

7474
if (req.isAuthenticated()) {
75-
console.log('request is already authenticated');
7675
return next();
7776
}
7877

src/service/passport/local.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ const configure = async (passport) => {
1313
return done(null, false, { message: "Incorrect username." });
1414
}
1515

16-
console.log(`Before bcrypt compare: user.password: ${user.password}`);
17-
console.log(`Before bcrypt compare: password: ${password}`);
1816
const passwordCorrect = await bcrypt.compare(password, user.password);
1917
if (!passwordCorrect) {
2018
return done(null, false, { message: "Incorrect password." });
@@ -49,7 +47,6 @@ const configure = async (passport) => {
4947
const createDefaultAdmin = async () => {
5048
const admin = await db.findUser("admin");
5149
if (!admin) {
52-
console.log("No admin user found. Creating default admin user...");
5350
await db.createUser("admin", "admin", "[email protected]", "none", true);
5451
}
5552
};

src/service/passport/oidc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const configure = async (passport) => {
5050
done(err);
5151
}
5252
})
53-
console.log(`setting type to ${server.host}`)
53+
5454
type = server.host;
5555

5656
return passport;

src/ui/auth/AuthProvider.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,10 @@ export const AuthProvider = ({ children }) => {
1616
const [isLoading, setIsLoading] = useState(true);
1717

1818
const refreshUser = async () => {
19-
console.log('Refreshing user');
2019
try {
2120
const data = await getUserInfo();
2221
setUser(data);
23-
console.log('User refreshed:', data);
2422
} catch (error) {
25-
console.error('Error refreshing user:', error);
2623
setUser(null);
2724
} finally {
2825
setIsLoading(false);

src/ui/components/PrivateRoute/PrivateRoute.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@ import { useAuth } from '../../auth/AuthProvider';
44

55
const PrivateRoute = ({ component: Component, adminOnly = false }) => {
66
const { user, isLoading } = useAuth();
7-
console.debug('PrivateRoute', { user, isLoading, adminOnly });
8-
7+
98
if (isLoading) {
10-
console.debug('Auth is loading, waiting');
119
return <div>Loading...</div>; // TODO: Add loading spinner
1210
}
1311

1412
if (!user) {
15-
console.debug('User not logged in, redirecting to login page');
1613
return <Navigate to="/login" />;
1714
}
1815

1916
if (adminOnly && !user.admin) {
20-
console.debug('User is not an admin, redirecting to not authorized page');
2117
return <Navigate to="/not-authorized" />;
2218
}
2319

test/testLogin.test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ describe('auth', async () => {
3131
password: 'admin',
3232
});
3333

34-
// Debug CI
35-
console.log("DEBUG testLogin.test.js: ");
36-
console.log(`res.body: ${JSON.stringify(res.body)}`);
37-
console.log(`res.headers: ${JSON.stringify(res.headers)}`);
38-
console.log(`res.status: ${res.status}`);
39-
console.log(`res.text: ${res.text}`);
40-
4134
expect(res).to.have.cookie('connect.sid');
4235
res.should.have.status(200);
4336

0 commit comments

Comments
 (0)