atinux / nuxt-auth-utils

Add Authentication to Nuxt applications with secured & sealed cookies sessions.
MIT License
981 stars 91 forks source link

Calling `useUserSession` on AWS Lambda leads to 500 internal server error #107

Closed lmiller1990 closed 5 months ago

lmiller1990 commented 5 months ago

I made a minimal app with just

<script setup>
const { loggedIn } = useUserSession();
</script>

<template>
  <div>
    {{ loggedIn }}
    <h1>Hi there!</h1>
  </div>
</template>

And I get 500 error on AWS Lambda. I am having trouble getting logs. I will continue debugging. Will / should this work out of the box using Cloud Functions?

Config is:

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  modules: ["nuxt-auth-utils"],
  nitro: {
    preset: "aws-lambda",
  },
  app: {
    cdnURL: "https://lachlannuxttest.s3.ap-southeast-2.amazonaws.com/",
  },
});
lmiller1990 commented 5 months ago

Seems to be working now... but I sometimes get a 500 on the auth callback. 🤯