mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-27 11:36:22 +00:00
feat: add captcha support for user login and enhance user profile page
- Refactored userLogin function to include captcha handling. - Introduced getCaptchaConfig API to fetch captcha configuration. - Added Captcha component to handle different captcha providers (hCaptcha, reCaptcha, Turnstile). - Updated LoginForm component to integrate captcha verification. - Created UserProfile component to display user information with avatar. - Implemented getUserByUsername API to fetch user details by username. - Removed deprecated LoginRequest interface from user model. - Enhanced navbar and layout with animation effects. - Removed unused user page component and added dynamic user profile routing. - Updated localization files to include captcha-related messages. - Improved Gravatar component for better avatar handling.
This commit is contained in:
5
web/src/components/user/index.tsx
Normal file
5
web/src/components/user/index.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
import { User } from "@/models/user";
|
||||
|
||||
export function UserPage({user}: {user: User}) {
|
||||
return <div>User: {user.username}</div>;
|
||||
}
|
13
web/src/components/user/user-profile.tsx
Normal file
13
web/src/components/user/user-profile.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
"use client"
|
||||
import { getUserByUsername } from "@/api/user";
|
||||
import { User } from "@/models/user";
|
||||
import { useEffect, useState } from "react";
|
||||
import { getGravatarByUser } from "../common/gravatar";
|
||||
|
||||
export function UserProfile({ user }: { user: User }) {
|
||||
return (
|
||||
<div className="flex">
|
||||
{getGravatarByUser({user,className: "rounded-full mr-4"})}
|
||||
</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user