-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
12 changed files
with
226 additions
and
70 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
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,12 +1,17 @@ | ||
import { refreshUserSession, signInToCCXP } from "@/lib/headless_ais"; | ||
import { NextRequest, NextResponse } from "next/server"; | ||
|
||
export const runtime = 'edge'; | ||
|
||
export const POST = async (req: NextRequest) => { | ||
const form = await req.formData(); | ||
const studentid = form.get("studentid"); | ||
const encryptedPassword = form.get("encryptedPassword"); | ||
|
||
if(!studentid || !encryptedPassword) return NextResponse.json({ error: { message: "Missing Student ID and Password" }}, { status: 400 }) | ||
|
||
return NextResponse.json(await refreshUserSession(studentid as string, encryptedPassword as string)); | ||
const res = await refreshUserSession(studentid as string, encryptedPassword as string); | ||
if(!res) { | ||
return NextResponse.json({ error: { message: "Something went wrong" }}, { status: 500 }); | ||
} | ||
return NextResponse.json(res); | ||
} |
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,12 +1,17 @@ | ||
import { signInToCCXP } from "@/lib/headless_ais"; | ||
import { NextRequest, NextResponse } from "next/server"; | ||
|
||
export const runtime = 'edge'; | ||
|
||
export const POST = async (req: NextRequest) => { | ||
const form = await req.formData(); | ||
const studentid = form.get("studentid"); | ||
const password = form.get("password"); | ||
|
||
if(!studentid || !password) return NextResponse.json({ error: { message: "Missing Student ID and Password" }}, { status: 400 }) | ||
|
||
return NextResponse.json(await signInToCCXP(studentid as string, password as string)); | ||
const res = await signInToCCXP(studentid as string, password as string) | ||
if(!res) { | ||
return NextResponse.json({ error: { message: "Something went wrong" }}, { status: 500 }); | ||
} | ||
return NextResponse.json(res); | ||
} |
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 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