-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Workspace Member Management in SQL
- Loading branch information
1 parent
dac79da
commit b62ab5f
Showing
22 changed files
with
197 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useAuth } from '@/contexts/auth/useAuth'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import useError from '@/contexts/error/useError'; | ||
import { useEffect } from 'react'; | ||
|
||
function useAuthRedirect() { | ||
const { isLoggedIn } = useAuth(); | ||
const navigate = useNavigate(); | ||
const { publishError } = useError(); | ||
|
||
useEffect(() => { | ||
if (!isLoggedIn) { | ||
publishError(Error('You need to be logged in to access this page')); | ||
navigate('/login'); | ||
} | ||
}, [isLoggedIn, navigate, publishError]); | ||
} | ||
|
||
export default useAuthRedirect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
begin ; | ||
drop table if exists "user"; | ||
drop table if exists resource cascade; | ||
drop table if exists workspace cascade; | ||
drop type if exists resource_type cascade; | ||
commit ; | ||
begin; | ||
|
||
drop table if exists workspace_member cascade; | ||
drop table if exists resource cascade; | ||
drop table if exists workspace cascade; | ||
drop table if exists "user" cascade; | ||
drop type if exists resource_type cascade; | ||
|
||
commit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.