Middleware mainly and actually there does not seem to be any (???) ready-made solution for server side authentication on lambda@edge if you do not want to use Amplify. NextAuth f.ex. does not work on edge ? hmm.. or does it, I got impression that it does not work when read github comments, have to test is.