mirror of
https://github.com/ditkrg/AuthorizationServerDemos.git
synced 2026-01-25 17:23:18 +00:00
fix things
This commit is contained in:
@@ -5,12 +5,19 @@ import store from "../../store";
|
||||
import Heading1 from "./Heading1";
|
||||
import Card from "./Card";
|
||||
|
||||
// Services
|
||||
import { signinRedirect } from "../../services/userService";
|
||||
|
||||
const LoginWindow = () => {
|
||||
const onUserLogin = () => {
|
||||
const user = { profile: { given_name: "John Doe" } };
|
||||
console.log(`User logged in!`);
|
||||
store.dispatch(storeUser(user));
|
||||
};
|
||||
// const onUserLogin = () => {
|
||||
// const user = { profile: { given_name: "John Doe" } };
|
||||
// console.log(`User logged in!`);
|
||||
// store.dispatch(storeUser(user));
|
||||
// };
|
||||
|
||||
function login() {
|
||||
signinRedirect();
|
||||
}
|
||||
|
||||
return (
|
||||
<Card>
|
||||
@@ -19,7 +26,7 @@ const LoginWindow = () => {
|
||||
<p className="text-black-custom font-light text-3xl mb-20">
|
||||
Login to your account to view your dashboard and register a new vehicle.
|
||||
</p>
|
||||
<Button onClickEvent={onUserLogin} text={"Login"} />
|
||||
<Button onClickEvent={login} text={"Login"} />
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from "react";
|
||||
import { signinRedirect } from "../services/userService";
|
||||
import { Redirect } from "react-router-dom";
|
||||
import { useSelector } from "react-redux";
|
||||
import Navbar from "./components/Navbar";
|
||||
@@ -9,10 +8,6 @@ import LoginWindow from "./components/LoginWindow";
|
||||
function Login() {
|
||||
const user = useSelector((state) => state.auth.user);
|
||||
|
||||
function login() {
|
||||
signinRedirect();
|
||||
}
|
||||
|
||||
return user ? (
|
||||
<Redirect to={"/"} />
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user