Login/logout updates
This commit is contained in:
parent
a35d18b5a9
commit
58e713c98b
4 changed files with 20 additions and 21 deletions
|
|
@ -27,8 +27,11 @@ type LoginProps = {
|
|||
};
|
||||
|
||||
export const Login: FC<LoginProps> = ({ session, baseURL }) => {
|
||||
const origin = baseURL;
|
||||
const callbackUrl = `${origin}/setup`;
|
||||
let origin = null;
|
||||
if (typeof window !== "undefined") {
|
||||
origin = window.location.origin;
|
||||
}
|
||||
const callbackUrl = `${origin}/link`;
|
||||
const [provider, setProvider] = useState(undefined);
|
||||
const [email, setEmail] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
|
|
@ -188,7 +191,7 @@ export const Login: FC<LoginProps> = ({ session, baseURL }) => {
|
|||
sx={buttonStyles}
|
||||
onClick={() =>
|
||||
signIn("azure-ad", {
|
||||
callbackUrl: `${origin}`,
|
||||
callbackUrl,
|
||||
})
|
||||
}
|
||||
>
|
||||
|
|
@ -225,13 +228,13 @@ export const Login: FC<LoginProps> = ({ session, baseURL }) => {
|
|||
<Grid item sx={{ width: "100%" }}>
|
||||
<IconButton
|
||||
sx={buttonStyles}
|
||||
onClick={() =>
|
||||
onClick={() => {
|
||||
signIn("credentials", {
|
||||
email,
|
||||
password,
|
||||
callbackUrl,
|
||||
})
|
||||
}
|
||||
});
|
||||
}}
|
||||
>
|
||||
<KeyIcon sx={{ mr: 1 }} />
|
||||
Sign in with Zammad credentials
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue