sveltekit-adapter-aws icon indicating copy to clipboard operation
sveltekit-adapter-aws copied to clipboard

Authentication with Authjs or other libraries

Open hiddengearz opened this issue 1 year ago • 7 comments

Hello,

I've spent all week trying to get authjs to work with this adapter and I'm at the point where I believe there is simply something incompatible between the two and I have no idea what it is. I have it working locally but I get errors I can't figure out when deployed to AWS.

Over the weekend I plan to test the template project to make sure it has nothing to do with my project but i was curious if anyone has used authjs or any other sort of stateless authentication with this adapter?

hiddengearz avatar Mar 01 '24 18:03 hiddengearz

Tried the adapter with sveltekit-auth-example and had the same issue, works fine locally.

hiddengearz avatar Mar 02 '24 21:03 hiddengearz

Hooks.server.ts is not included in any of the diagrams. Not sure if it's supported? Since Authjs uses it to intercept each request I'm guessing it would have to be it's own lambda which it might not be when using this adapter.

mblinusreimertz avatar Mar 14 '24 12:03 mblinusreimertz

Yes it does use hooks.server.ts.

Which diagram are you referring to? This one?

hiddengearz avatar Mar 15 '24 14:03 hiddengearz

Ok, cool. Yep that one, have you gotten it to work? :)

mblinusreimertz avatar Mar 18 '24 06:03 mblinusreimertz

I just set it up and it works fine for me. Could it be something with your Authjs set up?

mblinusreimertz avatar Mar 18 '24 12:03 mblinusreimertz

I never got it working with a lambda, I did get it working with AWS ECS.

Did you use the cognito provider?

hiddengearz avatar Mar 18 '24 12:03 hiddengearz

I used the credentials provder but I'm gonna try out Cognito within a couple of weeks.

mblinusreimertz avatar Mar 18 '24 13:03 mblinusreimertz