From b4163fc4bc7010cfbc8f434ce5f7215328966df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Cadenas?= Date: Mon, 8 May 2023 01:46:24 +0200 Subject: [PATCH] Update Login.tsx --- webapp/src/pages/login/Login.tsx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/webapp/src/pages/login/Login.tsx b/webapp/src/pages/login/Login.tsx index 5ca6aec..9f16097 100644 --- a/webapp/src/pages/login/Login.tsx +++ b/webapp/src/pages/login/Login.tsx @@ -2,10 +2,19 @@ import {useState} from "react"; import {Button, Container, FormGroup, TextField} from "@mui/material"; import "./login.css" import {LoginButton} from "@inrupt/solid-ui-react"; - +import { login } from "@inrupt/solid-client-authn-browser"; const Login = () => { const [idp, setIdp] = useState("https://inrupt.net"); + const handleSubmit = async (e:any) => { + + e.preventDefault(); //if not used, the page will reload and data will be lost + login({ + redirectUrl: "http://172.162.240.176:3000/main/", // after redirect, come to the actual page + oidcIssuer: idp, // redirect to the url + clientName: "Lo Map", + }); + }; return ( @@ -27,13 +36,16 @@ const Login = () => { onChange={(e: any) => setIdp(e.target.value)} InputProps={{ endAdornment: ( - - - + // ), }} />