Skip to content

Commit

Permalink
auth fix
Browse files Browse the repository at this point in the history
  • Loading branch information
youssef.el-mkhantar committed Jan 12, 2024
1 parent ddadb2d commit 0684e4c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_BASE_URL='https://wce-portail.local/backend'
VITE_BASE_URL='https://wce-portail.local/wce-api'
VITE_JITSI_DOMAIN='appel.preprod.webconf.numerique.gouv.fr'
VITE_VOXAPI_URL='https://preprod.webconf.numerique.gouv.fr/voxapi/apiconf'
GENERATE_SOURCEMAP=false
8 changes: 5 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,11 @@ function App() {
setMsg={setMsg}
setRoomName={setRoomName}
/>;
} else {
return <Navigate to={`/${roomName}`} />;
}
}
// else {
// return <Navigate to={`/${roomName}`} />;
// }
return <></>
};

const OtherRoutes = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function HeaderComponent({

const logOut = () => {
api
.get('/logout')
.get('/auth/logout')
.then(res => {
if (res.data.error) {
localStorage.setItem('auth', 'false');
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/AuthModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default function AuthModal(props: AuthModalProps) {
}, []);

const agentConnect = (room: string) => {
fetch(`${import.meta.env.VITE_BASE_URL}/login_authorize?room=${room}`, {
fetch(`${import.meta.env.VITE_BASE_URL}/auth/login_authorize?room=${room}`, {
redirect: 'manual',
}).then(res => {
if (res.type === 'opaqueredirect') {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login/LoginCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function LoginCallback({
}
api
.get(
`/login_callback?code=${urlParams.get('code')}&state=${urlParams.get(
`/auth/login_callback?code=${urlParams.get('code')}&state=${urlParams.get(
'state'
)}`
)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/login/LogoutCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function LogoutCallback({

useEffect(() => {
api
.get(`/logout_callback?state=${urlParams.get('state')}`)
.get(`/auth/logout_callback?state=${urlParams.get('state')}`)
.then(res => {
setAuthenticated(false);
localStorage.setItem('auth', 'false');
Expand Down

0 comments on commit 0684e4c

Please sign in to comment.