feat: simple OAuth2 login with JWT token
This commit is contained in:
@@ -59,6 +59,7 @@ export default function Analysis() {
|
||||
const [showControlPanel, setShowControlPanel] = useState(false);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
const auth = useAuthContext();
|
||||
// Function to generate and fetch the graph image
|
||||
async function loadImage() {
|
||||
setLoading(true);
|
||||
@@ -67,8 +68,7 @@ export default function Analysis() {
|
||||
setImage(data.image);
|
||||
setLoading(false);
|
||||
}).catch((e) => {
|
||||
const { checkAuth } = useAuthContext();
|
||||
checkAuth();
|
||||
auth.doLogin();
|
||||
})
|
||||
}
|
||||
|
||||
@@ -89,9 +89,6 @@ export default function Analysis() {
|
||||
}
|
||||
}
|
||||
|
||||
const { user } = useAuthContext()!
|
||||
console.log(`logged in as ${user.username}`);
|
||||
|
||||
return (
|
||||
<div className="stack column dropdown">
|
||||
<button onClick={() => setShowControlPanel(!showControlPanel)}>
|
||||
|
Reference in New Issue
Block a user