rant
How to learn OAuth
- Learn basic of OAuth https://authjs.dev/concepts/oauth
- Publish a series of blog posts about how OAuth works.
- Learn basics of Auth Js and implement it in a static page with a netlify route locally. ( A project similar to tina-cloud-starter-self-hosted-netlify-functions )
Two popular libraries to support OAuth are simple-oauth2 and Auth.js First try with simple-oauth2 , the example project below can be modified to be used with a different oAuth provider. https://github.com/netlify-labs/intercom-netlify-oauth/blob/master/package.js
I have cloned this project and also created Google Oauth client and secret. Present in my personal code folder. We might need to update this project to use netlify cli instead of netlify lambda. - Then try with express auth example. The benefit with auth-express (Auth.js) is that it also implements email-confirmation and magic link etc. https://github.com/nextauthjs/express-auth-example/tree/main We were not able to do the google login, maybe the client id was removed in google. Guide to deploy express app on netlify https://docs.netlify.com/frameworks/express/
- How to repurpose the express auth example for our blog.
https://chat.openai.com/share/346ff565-4c61-4e93-b415-2ac8baffa2c8
It should be easy to setup login , the tricky part is rendering “personal pages” only to authenticated users.
Check this chat with chatgpt : https://chat.openai.com/c/e6038eb2-e255-4b63-9970-35db4fa984ee
Also check this: https://www.netlify.com/blog/2021/08/12/how-to-include-files-in-netlify-serverless-functions/
Steps:
1. Add authors as a collection , AuthorName , description.etc.
2. Update the personal page in jekyll , so that it always refers to author.
3. Make sure , the website is working ( including links and page generation for each author (/user ) )
4. Read the blog and chat to render the personal pages through express app.
Here is how an hmac link/digest can be generated based on input email
https://chat.openai.com/c/a76f5d46-b9fd-4d91-985f-28dfc1acf6ee