adventurelibrary / ADVL-Issues

Repo for bugs on the Alpha build of Adventure Library
0 stars 0 forks source link

My bundle page malformed #9

Open Norc opened 3 years ago

Norc commented 3 years ago

Logged in, clicked "New bundle" and got this:

image

Also date joined is missing, in addition to the more obvious issue.

VikingStudio commented 3 years ago

Error is caused by login details not transferring correctly to the bundles_mine API request.

XHR GET https://staging.adventurelibrary.art/bundles/mine?limit=20&skip=0 [HTTP/2 401 Unauthorized 153ms] Error in fetch(): Route requires you to be logged in

advl-api : bundles.ts line 206. requireUser: true.

export const bundles_mine = newHandler({
  requireUser: true
}, async ({query, user}) => {
  query.user_id = user.id
  const result = await searchBundles(query)

  return {
    status: 200,
    body: result
  }
})
VikingStudio commented 3 years ago

This seems to be the same issue when opening the add to bundle modal from the home page. https://staging.adventurelibrary.art/bundles/mine?limit=20&skip=0 Returns a 401 Unauthorized error as well.

image

VikingStudio commented 3 years ago

Error returned from the handler for handlerOpts as user undefined. advl-api: handlers.ts, line 108.

      if (opts.includeUser || opts.requireUser) {
        let user : User | undefined
        try {
          user = await getEventUser(_evt)
        } catch (ex) {
          console.log('Error getting event user', ex)
        }
        if (!user && opts.requireUser) {
          return errorResponse(_evt, `Route requires you to be logged in`, 401)
        }
VikingStudio commented 3 years ago

Sometimes/inconsistently works on first load, showing the bundles. But moving to another page or moving to Settings and back to My Bundles causes the error repeatedly after that.