-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mnsrulz/main
sync: main to stage
- Loading branch information
Showing
19 changed files
with
445 additions
and
280 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,13 @@ | ||
import NextAuth, { NextAuthOptions } from 'next-auth' | ||
import NextAuth from 'next-auth' | ||
import { authOptions, NA } from '@/lib/auth'; | ||
|
||
import CredentialsProvider from 'next-auth/providers/credentials' | ||
import { authenticate } from '@/lib/auth' | ||
const { GET, POST } = NextAuth(authOptions).handlers; | ||
export { GET, POST } | ||
|
||
const authOptions: NextAuthOptions = { | ||
providers: [ | ||
CredentialsProvider({ | ||
name: 'credentials', | ||
credentials: { | ||
username: { label: "Username", type: "text", placeholder: "admin" }, | ||
password: { label: "Password", type: "password" } | ||
}, | ||
async authorize(creds, req) { | ||
if (authenticate(creds?.username, creds?.password)) { | ||
const user = { id: "1", name: "admin", email: "[email protected]" } | ||
return user | ||
} | ||
return null | ||
} | ||
}) | ||
] | ||
} | ||
// export const { | ||
// handlers: { GET, POST }, | ||
// auth, | ||
// } = NA; | ||
|
||
const handler = NextAuth(authOptions); | ||
|
||
export { handler as GET, handler as POST } | ||
// export { handler as GET, handler as POST } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { NextRequest, NextResponse } from "next/server"; | ||
import yf from 'yahoo-finance2'; | ||
|
||
export async function GET(request: NextRequest, p: { params: { symbol: string } }) { | ||
const q = request.nextUrl.searchParams.get('q'); | ||
if (!q) return NextResponse.json({ 'error': 'q parameter is not provided in the request.' }, { | ||
status: 400 | ||
}); | ||
const resp = await yf.search(q); | ||
return NextResponse.json({ | ||
items: resp | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function Page() { | ||
return <div> | ||
This is the login page!!! | ||
</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use client'; | ||
import { ITradeView } from "@/lib/types"; | ||
import { shortDateFormatter } from "./trades"; | ||
|
||
|
||
export const TickerName = (p: { trade: ITradeView; }) => { | ||
const { trade } = p; | ||
return <div>{trade.symbol} {trade.strikePrice as unknown as string} {shortDateFormatter(trade.contractExpiry as unknown as string)} x {trade.numberOfContracts}</div>; | ||
}; |
Oops, something went wrong.