diff --git a/.env b/.env
new file mode 100644
index 0000000..4f29f9a
--- /dev/null
+++ b/.env
@@ -0,0 +1 @@
+REACT_APP_IDENTITY_AUTHENTICATION_URL=http://localhost:5063/identity/authenticate?UserName={username}&Password={password}
\ No newline at end of file
diff --git a/src/features/login/components/LoginContainer.js b/src/features/login/components/LoginContainer.js
index 8c704f8..206e569 100644
--- a/src/features/login/components/LoginContainer.js
+++ b/src/features/login/components/LoginContainer.js
@@ -1,20 +1,27 @@
-import React from "react";
+import React, { useContext } from "react";
import LoginComponent from "./LoginComponent";
import Button from "@material-ui/core/Button";
-import { useHistory } from "react-router-dom";
+import { authenticate } from "../../../utils/identity";
+import {
+ ApplicationStateContext,
+ ApplicationDispatchContext
+} from "../../../state/ApplicationContexts";
const LoginContainer = () => {
- const history = useHistory();
+ const state = useContext(ApplicationStateContext);
+ const dispatchActions = useContext(ApplicationDispatchContext);
- const handleMove = () => {
- history.push("about");
+ const handleLogin = async () => {
+ const { userName, password } = state.credentials;
+ const token = await authenticate(userName, password);
+ dispatchActions.onAuthorizationTokenChange(token);
};
return (
<>
-