Refactored useApi usage.
This commit is contained in:
@@ -4,7 +4,7 @@ import ipaddr from 'ipaddr.js';
|
||||
import { createToken, unauthorized, send, badRequest, forbidden } from 'next-basics';
|
||||
import { savePageView, saveEvent } from 'queries';
|
||||
import { useCors, useSession } from 'lib/middleware';
|
||||
import { getJsonBody, getIpAddress } from 'lib/request';
|
||||
import { getJsonBody, getIpAddress } from 'lib/detect';
|
||||
import { secret } from 'lib/crypto';
|
||||
import { NextApiRequest, NextApiResponse } from 'next';
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { removeItem, useApi } from 'next-basics';
|
||||
import { AUTH_TOKEN } from 'lib/constants';
|
||||
import useApi from 'hooks/useApi';
|
||||
import { setUser } from 'store/app';
|
||||
import { removeClientAuthToken } from 'lib/client';
|
||||
|
||||
export default function LogoutPage() {
|
||||
const router = useRouter();
|
||||
@@ -13,7 +13,7 @@ export default function LogoutPage() {
|
||||
await post('/logout');
|
||||
}
|
||||
|
||||
removeItem(AUTH_TOKEN);
|
||||
removeClientAuthToken();
|
||||
|
||||
logout();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user