Skip to content

Instantly share code, notes, and snippets.

View SirojbekMaqsudov's full-sized avatar
🎯
Focusing

Sirojbek Maqsudov SirojbekMaqsudov

🎯
Focusing
View GitHub Profile
@SirojbekMaqsudov
SirojbekMaqsudov / api.js
Last active April 6, 2024 21:49
next-auth token refresh rotation and axios interceptor
import axios from "axios";
import {getCsrfToken, getSession, signOut} from "next-auth/react";
const refreshToken = async (token) => {
const response = await fetch(`${process.env.API_URL}/auth/refresh`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
@mjbalcueva
mjbalcueva / calendar.tsx
Last active October 14, 2024 08:08
shadcn ui calendar custom year and month dropdown
"use client"
import * as React from "react"
import { buttonVariants } from "@/components/ui/button"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { cn } from "@/lib/utils"
import { ChevronLeft, ChevronRight } from "lucide-react"
import { DayPicker, DropdownProps } from "react-day-picker"