mirror of
https://github.com/ditkrg/AuthorizationServerDemos.git
synced 2026-01-25 15:33:04 +00:00
fix things
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
"tailwindcss": "^2.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "set HTTPS=true set SSL_CRT_FILE=cert.pem set SSL_KEY_FILE=key.pem && react-scripts start",
|
||||
"start": "HTTPS=true react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
|
||||
@@ -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