File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "main" : " dist/index.js" ,
77 "files" : [" dist" ],
88 "license" : " WTFPL" ,
9- "version" : " 0.1.2 " ,
9+ "version" : " 0.1.3 " ,
1010 "type" : " module" ,
1111 "repository" : {
1212 "type" : " git" ,
Original file line number Diff line number Diff line change 11import { NextRequest , NextResponse } from "next/server" ;
22import { cookies } from "next/headers" ;
3+ import { redirect } from "next/navigation" ;
34import { type Session , getGlobalConfig } from "./index" ;
45import jwt from "jsonwebtoken" ;
56
@@ -17,14 +18,14 @@ export const getSession = async (): Promise<Session | null> => {
1718 }
1819} ;
1920
20- export const signIn = async ( req : NextRequest ) : Promise < NextResponse > => {
21+ export const signIn = async ( ) : Promise < NextResponse > => {
2122 const config = getGlobalConfig ( ) ;
2223 const session = await getSession ( ) ;
2324 if ( session ) {
2425 return NextResponse . json ( { message : "Already signed in" } , { status : 200 } ) ;
2526 }
2627 const signInURL = `https://discord.com/api/oauth2/authorize?client_id=${ config . clientId } &redirect_uri=${ encodeURIComponent ( config . redirectUri ) } &response_type=code&scope=${ config . scopes . join ( " " ) } ` ;
27- return NextResponse . redirect ( signInURL , 302 ) ;
28+ return redirect ( signInURL ) ;
2829} ;
2930
3031export const signOut = async ( ) : Promise < NextResponse > => {
You can’t perform that action at this time.
0 commit comments