Skip to content

Commit

Permalink
login hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrrsin committed Apr 22, 2024
1 parent e11996c commit c0c91c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion webapp/src/components/AddUser.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// src/components/AddUser.js
import React, { useState } from 'react';
import axios from 'axios';
import { Snackbar } from '@mui/material';
import { Container, Typography, TextField, Button, Snackbar } from '@mui/material';
import { Link } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000';
Expand Down
11 changes: 6 additions & 5 deletions webapp/src/components/Login.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// src/components/Login.js
import React, { useState } from 'react';
import axios from 'axios';
import { Snackbar } from '@mui/material';

import useSignIn from 'react-auth-kit/hooks/useSignIn';
// import { useNavigate } from 'react-router-dom';
import { Container, Typography, TextField, Button, Snackbar } from '@mui/material';
import { useNavigate } from 'react-router-dom';
import { Link } from 'react-router-dom';
const Login = () => {
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [error, setError] = useState('');
const signIn = useSignIn();
// const navigate = useNavigate();
const navigate = useNavigate();
const [openSnackbar, setOpenSnackbar] = useState(false);

const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000';
Expand All @@ -33,8 +34,8 @@ const Login = () => {
}
})) { // Only if you are using refreshToken feature
// Redirect or do-something
// navigate('/');
window.location.href = '/';
navigate('/');
//window.location.href = '/';
} else {
//Throw error

Expand Down

0 comments on commit c0c91c7

Please sign in to comment.