Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
fix(login): fallback campusphere origin to ampUrl2
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Mar 30, 2021
1 parent 7cdb1bd commit 76d25eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,14 @@ class School {
(err) => err
)
res = await JSON.parse(await res.text())

const origin = new URL(res.data[0].ampUrl).origin
const schoolName = res.data[0].name

let origin = new URL(res.data[0].ampUrl).origin
let casOrigin = res.data[0].idsUrl

// fall back to ampUrl2 when campusphere not included in the `origin`
if (!origin.includes('campusphere')) origin = new URL(res.data[0].ampUrl2).origin

// Proxy the host who blocks foreign ip access
if (process.env.GITHUB_ACTION && name === 'whpu') {
casOrigin = 'https://lean.beetcb.com/authserver'
Expand Down

0 comments on commit 76d25eb

Please sign in to comment.