atinux / nuxt-auth-utils

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

feat: cognito oauth support custom domain #143

Closed zackspear closed 2 months ago

zackspear commented 3 months ago

Hey there,

We have a AWS Cognito Pool configured to use a custom domain for the hosted UI (docs on that).

During that configuration you can choose to delete the provided Cognito domain (Step 1.5 in the docs, see their note) – ${config.userPoolId}.auth.${config.region}.amazoncognito.com. If that occurs then the existing implementation of oauthCognitoEventHandler doesn't work.

This PR adds the functionality to provide the custom domain via the provider config. If config.domain isn't set then the default will still be made using config.userPoolId and config.region.