Skip to content

Commit 5189c90

Browse files
authored
Add Login Dialog (#173)
1 parent 2ed7547 commit 5189c90

File tree

2 files changed

+64
-4
lines changed

2 files changed

+64
-4
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import {
2+
Typography,
3+
Button,
4+
Dialog,
5+
DialogContent,
6+
DialogContentText,
7+
DialogTitle,
8+
Link,
9+
Stack,
10+
} from "@mui/material";
11+
12+
function LoginDialog({ open, handleClose, redirectPath }) {
13+
return (
14+
<Dialog
15+
open={open}
16+
onClose={handleClose}
17+
aria-labelledby="login-dialog-title"
18+
aria-describedby="login-dialog-description"
19+
>
20+
<DialogTitle
21+
id="login-dialog-title"
22+
sx={{ display: "flex", justifyContent: "center" }}
23+
>
24+
<Typography variant="h4">Sign in to continue</Typography>
25+
</DialogTitle>
26+
<DialogContent>
27+
<DialogContentText id="login-dialog-description">
28+
<Stack sx={{ alignItems: "center" }}>
29+
<Typography variant="body" gutterBottom>
30+
Access 100+ community applications for free. Use ChatGPT, GPT-4,
31+
Claude 2, DALLE 3, and others - all on Promptly.
32+
</Typography>
33+
<Stack sx={{ width: "100%", alignItems: "center" }}>
34+
<Link
35+
underline="none"
36+
href={
37+
redirectPath
38+
? `/api/provider/login?provider_id=google&redirectUrl=${redirectPath}`
39+
: "/api/provider/login?provider_id=google"
40+
}
41+
>
42+
<Button variant="contained" autoFocus>
43+
Login With Google
44+
</Button>
45+
</Link>
46+
</Stack>
47+
<Typography variant="caption" sx={{ marginTop: "4px" }}>
48+
By continuing, you agree to our{" "}
49+
<span>
50+
<a href="https://www.trypromptly.com/tos">Terms of Service</a>
51+
</span>{" "}
52+
and{" "}
53+
<span>
54+
<a href="https://www.trypromptly.com/privacy">Privacy Policy</a>
55+
</span>
56+
</Typography>
57+
</Stack>
58+
</DialogContentText>
59+
</DialogContent>
60+
</Dialog>
61+
);
62+
}
63+
64+
export default LoginDialog;

llmstack/server/adapters.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,3 @@ def populate_user(self, request, sociallogin, data):
5050
user.email = user.username
5151

5252
return user
53-
54-
def get_connect_redirect_url(self, request, socialaccount):
55-
logger.debug(f"get_connect_redirect_url: params: {request.GET}")
56-
return request.GET.get("redirectUrl", "/")

0 commit comments

Comments
 (0)