feat: auth
This commit is contained in:
1 parent
8cb7fed6ef
commit
fdec33ae64
6 files changed
+35
-9
No files matched your search
@@ -8,6 +8,10 @@ import yts from './parsers/yts';
|
|||||||
import http from './Http';
|
import http from './Http';
|
||||||
import { Sort } from './parsers';
|
import { Sort } from './parsers';
|
||||||
|
|
||||||
|
export const createRequestToken = async () => {
|
||||||
|
return http.get<RequestToken>('/authentication/token/new').then(({ request_token }) => request_token);
|
||||||
|
};
|
||||||
|
|
||||||
export const search = async ({
|
export const search = async ({
|
||||||
query,
|
query,
|
||||||
page,
|
page,
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { UserRound } from 'lucide-react';
|
||||||
|
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
|
||||||
|
const User = () => {
|
||||||
|
return (
|
||||||
|
<Button variant='ghost' size='icon'>
|
||||||
|
<UserRound size={20} />
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default User;
|
||||||
@@ -7,6 +7,7 @@ import { cn } from '@/lib/utils';
|
|||||||
import { DesktopNavigation, MobileNavigation } from './components/Navigation';
|
import { DesktopNavigation, MobileNavigation } from './components/Navigation';
|
||||||
import ToggleSearch from './components/Search';
|
import ToggleSearch from './components/Search';
|
||||||
import ToggleTheme from './components/ThemeToggle';
|
import ToggleTheme from './components/ThemeToggle';
|
||||||
|
import User from './components/User';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: string;
|
className?: string;
|
||||||
@@ -28,6 +29,7 @@ const Header: FC<Props> = ({ className }) => (
|
|||||||
<div className='flex items-center gap-2'>
|
<div className='flex items-center gap-2'>
|
||||||
<ToggleTheme />
|
<ToggleTheme />
|
||||||
<ToggleSearch />
|
<ToggleSearch />
|
||||||
|
<User />
|
||||||
<MobileNavigation />
|
<MobileNavigation />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Generated
+9
-8
@@ -27,7 +27,7 @@
|
|||||||
"eslint-config-next": "^14.2.7",
|
"eslint-config-next": "^14.2.7",
|
||||||
"jotai": "^2.2.2",
|
"jotai": "^2.2.2",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"lucide-react": "^0.263.0",
|
"lucide-react": "^0.453.0",
|
||||||
"media-icons": "^1.1.5",
|
"media-icons": "^1.1.5",
|
||||||
"next": "^14.2.7",
|
"next": "^14.2.7",
|
||||||
"node-html-parser": "^6.1.5",
|
"node-html-parser": "^6.1.5",
|
||||||
@@ -5137,11 +5137,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lucide-react": {
|
"node_modules/lucide-react": {
|
||||||
"version": "0.263.0",
|
"version": "0.453.0",
|
||||||
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.263.0.tgz",
|
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.453.0.tgz",
|
||||||
"integrity": "sha512-F+rHswbbI1xuDZ/OzofiJZJVlBPOIYVVST705cPdRLImJ5aOJNXYaFBPNo3qdUV0iEG/4nZeiUtLSHO2qU2ISw==",
|
"integrity": "sha512-kL+RGZCcJi9BvJtzg2kshO192Ddy9hv3ij+cPrVPWSRzgCWCVazoQJxOjAwgK53NomL07HB7GPHW120FimjNhQ==",
|
||||||
|
"license": "ISC",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"react": "^16.5.1 || ^17.0.0 || ^18.0.0"
|
"react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/media-captions": {
|
"node_modules/media-captions": {
|
||||||
@@ -10383,9 +10384,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lucide-react": {
|
"lucide-react": {
|
||||||
"version": "0.263.0",
|
"version": "0.453.0",
|
||||||
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.263.0.tgz",
|
"resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.453.0.tgz",
|
||||||
"integrity": "sha512-F+rHswbbI1xuDZ/OzofiJZJVlBPOIYVVST705cPdRLImJ5aOJNXYaFBPNo3qdUV0iEG/4nZeiUtLSHO2qU2ISw==",
|
"integrity": "sha512-kL+RGZCcJi9BvJtzg2kshO192Ddy9hv3ij+cPrVPWSRzgCWCVazoQJxOjAwgK53NomL07HB7GPHW120FimjNhQ==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"media-captions": {
|
"media-captions": {
|
||||||
|
|||||||
+1
-1
@@ -29,7 +29,7 @@
|
|||||||
"eslint-config-next": "^14.2.7",
|
"eslint-config-next": "^14.2.7",
|
||||||
"jotai": "^2.2.2",
|
"jotai": "^2.2.2",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"lucide-react": "^0.263.0",
|
"lucide-react": "^0.453.0",
|
||||||
"media-icons": "^1.1.5",
|
"media-icons": "^1.1.5",
|
||||||
"next": "^14.2.7",
|
"next": "^14.2.7",
|
||||||
"node-html-parser": "^6.1.5",
|
"node-html-parser": "^6.1.5",
|
||||||
|
|||||||
Vendored
+6
@@ -165,3 +165,9 @@ interface FileStat {
|
|||||||
path: string;
|
path: string;
|
||||||
length: number;
|
length: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface RequestToken {
|
||||||
|
success: boolean;
|
||||||
|
expires_at: string;
|
||||||
|
request_token: string;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user