mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
feat: apply auth to container and cli client
This commit is contained in:
1 parent
030dc95e24
commit
0f53696f71
8 files changed
+64
-27
No files matched your search
@@ -5,7 +5,7 @@ import SessionHandler from '../../game/sessionHandler.js'
|
||||
|
||||
export async function getSessionList(req, res) {
|
||||
try {
|
||||
const query = { user: req.user.id }
|
||||
const query = { user: req.user._id }
|
||||
if (req.query.quest_id) {
|
||||
query.quest = req.query.quest_id
|
||||
}
|
||||
@@ -70,7 +70,7 @@ export async function getSessionById(req, res) {
|
||||
try {
|
||||
const session = await Session.findOne({
|
||||
_id: req.params.id,
|
||||
user: req.user.id,
|
||||
user: req.user._id,
|
||||
})
|
||||
|
||||
if (!session) {
|
||||
@@ -88,7 +88,7 @@ export async function deleteSessionById(req, res) {
|
||||
try {
|
||||
const session = await Session.findOneAndDelete({
|
||||
_id: req.params.id,
|
||||
user: req.user.id,
|
||||
user: req.user._id,
|
||||
})
|
||||
|
||||
if (!session) {
|
||||
|
||||
Reference in new issue
Block a user