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

Commit

Permalink
fix: make cookie vaildation reasonable
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Mar 30, 2021
1 parent 2b299c5 commit f0172f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion campusphere/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ exports.signApp = class signApp extends campusphereApp {
process.env[user.username] = user
}

/**
* @param {*} cookie stored cookie
* @return {boolean} true if cookie is invalid
*/
async signInfo(cookie) {
const user = process.env[this.id]
if (!cookie) {
Expand All @@ -42,7 +46,8 @@ exports.signApp = class signApp extends campusphereApp {
headers,
body: JSON.stringify({}),
})
if (res.headers.hasOwnProperty('set-cookie')) return true
// TODO: handle the responsed updated cookie
if (!res.ok) return true
const signQ = await res.json()
this.curTask = signQ.datas.unSignedTasks[0]
return false
Expand Down

0 comments on commit f0172f7

Please sign in to comment.