mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
fixed token checking
This commit is contained in:
parent
9c436d348c
commit
48cf0b93ee
4 changed files with 25 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
import { API } from '~/constants/api';
|
||||
import { IRootState, IRouteListItem } from '~/redux/user';
|
||||
import { IRootState } from '~/redux/user';
|
||||
import { IUser } from '~/constants/auth';
|
||||
import { CLIENT } from '~/config/frontend';
|
||||
import { LatLngLiteral } from 'leaflet';
|
||||
|
@ -7,7 +7,7 @@ import { IRoute } from '~/redux/map/types';
|
|||
import { INominatimResult } from '~/redux/types';
|
||||
import { api } from './instance';
|
||||
import { postMapInterceptor } from '~/utils/api/interceptors';
|
||||
import { PostMapRequest, PostMapResponse } from '~/utils/api/types';
|
||||
import { CheckTokenRequest, CheckTokenResult, PostMapRequest, PostMapResponse } from '~/utils/api/types';
|
||||
|
||||
interface IGetRouteList {
|
||||
min: number;
|
||||
|
@ -20,16 +20,11 @@ interface IGetRouteList {
|
|||
|
||||
export const checkUserToken = ({
|
||||
id,
|
||||
}: {
|
||||
id: IRootState['user']['id'];
|
||||
}) =>
|
||||
token,
|
||||
}: CheckTokenRequest) =>
|
||||
api
|
||||
.get<{
|
||||
user: IUser;
|
||||
random_url: string;
|
||||
routes: IRouteListItem[];
|
||||
}>(API.CHECK_TOKEN, {
|
||||
params: { id },
|
||||
.get<CheckTokenResult>(API.CHECK_TOKEN, {
|
||||
params: { id, token },
|
||||
});
|
||||
|
||||
export const getGuestToken = () =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue