Skip to content

Commit fe30338

Browse files
fixed a few errors including removing unused packages
1 parent 8a5afa9 commit fe30338

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

app/components/AuthenticatedHome.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from 'react';
22
import Link from 'next/link';
3-
import { User } from '@clerk/nextjs/server';
3+
import { UserResource } from '@clerk/types';
44
import { Leaf, Droplet, MessageSquare, Bug, Satellite } from 'lucide-react';
55

66
interface AuthenticatedHomeProps {
7-
user: User | null;
7+
user: UserResource | null;
88
}
99

1010
const FeatureCard: React.FC<{ title: string; description: string; icon: React.ReactNode; href: string }> = ({ title, description, icon, href }) => (

pages/api/login.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
import jwt from 'jsonwebtoken';
2-
3-
const JWT_SECRET = process.env.JWT_SECRET;
4-
51
export default function handler(req, res) {
62
if (req.method === 'POST') {
73
const { username, password } = req.body;
84

95
// In a real application, you would validate the username and password against a database
106
// For this example, we'll use a hardcoded check
117
if (username === 'admin' && password === 'password') {
12-
const token = jwt.sign({ username }, JWT_SECRET, { expiresIn: '1h' });
13-
res.status(200).json({ token });
8+
res.status(200).json({ message: 'Login successful' });
149
} else {
1510
res.status(401).json({ message: 'Invalid credentials' });
1611
}

0 commit comments

Comments
 (0)