MCPcopy Create free account
hub / github.com/BingyanStudio/github-analyzer / Login

Function Login

web/src/pages/Login.tsx:12–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10import { Github } from "lucide-react";
11
12const Login = () => {
13 const handleGithubLogin = () => {
14 const clientId = import.meta.env.VITE_OAUTH_CLIENT_ID;
15 const redirectUri = `${window.location.origin}/callback`;
16 const scope = "user repo";
17
18 window.location.href = `https://github.com/login/oauth/authorize?client_id=${clientId}&redirect_uri=${redirectUri}&scope=${scope}`;
19 };
20
21 return (
22 <div className="flex justify-center items-center min-h-screen bg-gradient-to-b from-background to-background/80">
23 <div className="absolute inset-0 overflow-hidden z-0">
24 <div className="absolute top-1/4 left-1/2 w-96 h-96 bg-primary/5 rounded-full -translate-x-1/2 blur-3xl"></div>
25 <div className="absolute bottom-1/4 right-1/4 w-64 h-64 bg-primary/10 rounded-full blur-2xl"></div>
26 </div>
27
28 <Card className="w-[400px] mx-6 border shadow-lg relative z-10 overflow-hidden">
29 <CardHeader className="space-y-4 pb-6">
30 <div className="flex justify-center">
31 <div className="p-3 bg-primary/10 rounded-full">
32 <Github className="h-8 w-8 text-primary" />
33 </div>
34 </div>
35 <div className="text-center space-y-1.5">
36 <CardTitle className="text-2xl">GitHub 锐评</CardTitle>
37 <CardDescription>让 AI 锐评一下你都在做什么吧</CardDescription>
38 </div>
39 </CardHeader>
40 <CardContent>
41 <Button
42 onClick={handleGithubLogin}
43 className="w-full py-4 h-auto text-base flex gap-2 shadow-sm hover:shadow transition-all"
44 >
45 <Github size={20} />
46 GitHub 登录
47 </Button>
48 </CardContent>
49 <CardFooter className="px-8 pb-6 flex flex-col items-center space-y-2">
50 <p className="text-sm text-muted-foreground text-center w-full mt-1">
51 Powered by
52 <a
53 href="https://www.bingyan.net/"
54 className="text-[#F5AB3D] underline"
55 target="_blank"
56 >
57 <img
58 src="/by-logo.png"
59 alt="Logo"
60 className="inline-block h-6 w-6 ms-1"
61 />
62 BingyanStudio
63 </a>
64 </p>
65 </CardFooter>
66 </Card>
67 </div>
68 );
69};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected