-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
258 additions
and
156 deletions.
There are no files selected for viewing
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
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
23 changes: 21 additions & 2 deletions
23
apps/dashboard/src/app/api/plaid/create-link-token/route.ts
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,3 +1,22 @@ | ||
export async function POST(req: Request) { | ||
return Response.json({ success: true }); | ||
import { PlaidApi } from "@midday/providers/src/plaid/plaid-api"; | ||
import { createClient } from "@midday/supabase/server"; | ||
import { NextResponse } from "next/server"; | ||
|
||
export async function POST() { | ||
try { | ||
const supabase = createClient(); | ||
const api = new PlaidApi(); | ||
|
||
const { | ||
data: { session }, | ||
} = await supabase.auth.getSession(); | ||
|
||
const response = await api.linkTokenCreate({ | ||
userId: session.user.id, | ||
}); | ||
|
||
return NextResponse.json(response.data); | ||
} catch (error) { | ||
// handle error | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
apps/dashboard/src/app/api/plaid/exchange-public-token/route.ts
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,17 @@ | ||
import { PlaidApi } from "@midday/providers/src/plaid/plaid-api"; | ||
import { NextResponse } from "next/server"; | ||
|
||
export async function POST(req: Request) { | ||
try { | ||
const res = await req.json(); | ||
const api = new PlaidApi(); | ||
|
||
const response = await api.itemPublicTokenExchange({ | ||
publicToken: res.public_token, | ||
}); | ||
|
||
return NextResponse.json(response.data); | ||
} catch (error) { | ||
// handle error | ||
} | ||
} |
This file was deleted.
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.