Skip to content

Commit

Permalink
test: add logout admin e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Apr 19, 2024
1 parent 81c6eb4 commit cad7ba7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pwa/components/admin/authProvider.tsx
Expand Up @@ -7,6 +7,7 @@ const authProvider: AuthProvider = {
// Nothing to do here, this function will never be called
login: async () => Promise.resolve(),
logout: async () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { data: session } = useSession();
if (!session) {
return;
Expand All @@ -18,6 +19,7 @@ const authProvider: AuthProvider = {
});
},
checkError: async (error) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { data: session } = useSession();
const status = error.status;
// @ts-ignore
Expand All @@ -32,6 +34,7 @@ const authProvider: AuthProvider = {
}
},
checkAuth: async () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { data: session } = useSession();
// @ts-ignore
if (!session || session?.error === "RefreshAccessTokenError") {
Expand All @@ -45,6 +48,7 @@ const authProvider: AuthProvider = {
getPermissions: () => Promise.resolve(),
// @ts-ignore
getIdentity: async () => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const { data: session } = useSession();

return session ? Promise.resolve(session.user) : Promise.reject();
Expand Down

0 comments on commit cad7ba7

Please sign in to comment.