diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index 22f284e..7c1fe8d 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -12,23 +12,42 @@ export default { '/guppy/': guppyGuide(), '/wish/': wishGuide(), '/create-sails/': createSailsGuide(), - '/inertia-sails/': inertiaSailsGuide() + '/inertia-sails/': inertiaSailsGuide(), + '/mail/': mailGuide() + }, + sitemap: { + hostname: 'https://docs.sailscasts.com' }, editLink: { pattern: 'https://github.com/sailscastshq/docs.sailscasts.com/edit/develop/docs/:path', text: 'Edit this page on GitHub' }, + head: [ + ['meta', { name: 'theme-color', content: '#07162d' }], + ['meta', { name: 'og:type', content: 'website' }], + ['meta', { name: 'og:locale', content: 'en' }], + ['meta', { name: 'og:site_name', content: 'Sailscasts Docs' }], + [ + 'script', + { + src: 'https://cdn.usefathom.com/script.js', + 'data-site': 'OTDOQLCI', + 'data-spa': 'auto', + defer: '' + } + ] + ], socialLinks: [ { icon: 'github', link: 'https://github.com/sailscastshq/docs.sailscasts.com' }, { icon: 'twitter', link: 'https://twitter.com/sailscastshq' }, - { icon: 'discord', link: 'https://discord.com/invite/gbJZuNm' }, + { icon: 'discord', link: 'https://sailscasts.com/chat' }, { icon: 'youtube', - link: 'https://www.youtube.com/channel/UCje9Wo6cbh3IERItPbyq1QA' + link: 'https://youtube.com/@sailscasts' } ], footer: { @@ -46,16 +65,20 @@ export default { function nav() { return [ { - text: 'Software', - items: [{ text: 'guppy', link: '/guppy/' }] + text: 'Commercial projects', + items: [ + { text: 'Guppy', link: '/guppy/' }, + { text: 'Hagfish', link: '/hagfish/' } + ] }, { text: 'Open Source', items: [ { text: 'create-sails', link: '/create-sails/' }, { text: 'inertia-sails', link: '/inertia-sails/' }, - { text: 'wish', link: '/wish/' }, - { text: 'captain-vane', link: '/captain-vane/' } + { text: 'Wish', link: '/wish/' }, + { text: 'captain-vane', link: '/captain-vane/' }, + { text: 'Mail', link: '/mail/', activeMatch: '/mail/' } // { text: 'sailboat', link: '/sailboat/' }, ] }, @@ -145,7 +168,7 @@ function wishGuide() { collapsible: true, items: [ { text: 'Introduction', link: '/wish/' }, - { text: 'What is wish?', link: '/wish/what-is-wish' }, + { text: 'What is Wish?', link: '/wish/what-is-wish' }, { text: 'Installation', link: '/wish/installation' } ] }, @@ -202,3 +225,38 @@ function inertiaSailsGuide() { } ] } + +function mailGuide() { + return [ + { + text: 'Introduction', + collapsed: false, + items: [ + { text: 'Getting Started', link: 'mail/getting-started' }, + { text: 'Configuration', link: 'mail/configuration' } + ] + }, + { + text: 'Transports', + collapsed: false, + items: [ + { text: 'SMTP', link: 'mail/smtp-transport' }, + { text: 'Resend', link: 'mail/resend-transport' }, + { text: 'Local Development', link: 'mail/local-development' } + ] + }, + { + text: 'Writing Emails', + collapsed: false, + items: [ + { text: 'Template', link: 'mail/email-template' }, + { text: 'Layout', link: 'mail/email-layout' } + ] + }, + { + text: 'Sending Emails', + collapsed: false, + items: [{ text: 'Send Helper', link: 'mail/send-helper' }] + } + ] +} diff --git a/docs/mail/configuration.md b/docs/mail/configuration.md new file mode 100644 index 0000000..16f083c --- /dev/null +++ b/docs/mail/configuration.md @@ -0,0 +1,73 @@ +--- +title: Configuration +editLink: true +prev: + text: 'Getting Started' + link: '/mail/getting-started' +next: + text: 'SMTP Transport' + link: '/mail/smtp-transport' +--- + +# {{ $frontmatter.title }} + +To configure mail, create a `config/mail.js` configuration file. Let's look at all the possible configurations you can have in `config/mail.js` + +## default + +The `default` config in `config/mail.js` tells Mail which mailer to use by default. The string passed to `default` must be the name of a registered mailer in the `mailers` object + +```js[config/mail.js] +module.exports.mail = { + default: 'log' // replace 'log' with any configured mailer you've set +} +``` + +You can also set the `default` mailer with the `MAIL_MAILER` environment variable and Mail will automatically detect it. + +This is handy for specifying different default mailers in different environments your application will be running in. + +Also in `config/local.js` you specify a `mailer` which will be used as the default mailer in development. + +```js +//config/local.js +mailer: 'nodemailer' +``` + +## mailers + +The `mailers` configuration object contains + +```js + mailers: { + log: { + transport: 'log' + }, + mailtrap: { + transport: 'smtp' + }, + resend: { + transport: 'resend' + } + }, +``` + +:::info What's a mailer? + +In Mail, a mailer is a configuration object that is registered in the `mailers` object in `config/mails.js` that specifies at the very least a transport that Mail will use in sending your emails. +::: + +## from + +This config let you set a global from address for all your emails. It's really useful if your application sends emails from the same from address. + +By default Mail will use this address if no address is passed when you send an email with `sails.helpers.mail.send` + +```js +from: { + address: 'boring@sailscasts.com', + name: 'The Boring JavaScript Stack' +} +``` + +You can also set this config by specifying these two environment variables: `MAIL_FROM_NAME` and `MAIL_FROM_ADDRESS`. diff --git a/docs/mail/email-layout.md b/docs/mail/email-layout.md new file mode 100644 index 0000000..6569e42 --- /dev/null +++ b/docs/mail/email-layout.md @@ -0,0 +1,48 @@ +--- +title: Email Layout +editLink: true +prev: + text: 'Email Template' + link: '/mail/email-template' +next: + text: 'Send Helper' + link: '/mail/send-helper' +--- + +# {{ $frontmatter.title }} + +You can create layouts for the emails in your Sails application. This layout file, like [templates](/mail/email-template) is expected to be an EJS template. + +## Default layout + +By default, Mail will look for a layout file in `views/layouts` called `layout-email.ejs` to use as the default layout for all your email templates. + +## Example + +Here is an example email layout that's in `views/layouts/layout-email.ejs`: + +```html +<% /* Default layout for email templates */ %> +
+
+
+ <%- body %> +
+
+

+ © 2023 The Boring JavaScript Stack
+ All trademarks, service marks, and company names are the property of + their respective owners. +

+
+
+
+``` + +Your email templates will be injected in the spot marked by `<%- body %>` above. diff --git a/docs/mail/email-template.md b/docs/mail/email-template.md new file mode 100644 index 0000000..cf6f24d --- /dev/null +++ b/docs/mail/email-template.md @@ -0,0 +1,55 @@ +--- +title: Email Template +editLink: true +prev: + text: 'Local Development' + link: '/mail/local-development' +next: + text: 'Email Layout' + link: '/mail/email-layout' +--- + +# {{ $frontmatter.title }} + +Mail expects your email templates to be written in EJS template files or whatever template engine you've setup in your Sails project. These files are expected to be in the `views/emails` directory. + +## Naming convention + +When writing your email templates, you should prepend the file name with `email-` for example for an email template to send the account verification email to a user, the template can be named as `email-confirm-account.ejs` + +## Example + +Here is an example email template that's in `views/emails/email-verify-account.ejs`: + +```html +

+ Welcome, <%= fullName %>! +

+

+ You're almost ready to get started. Just click the button below to verify the + email address for your account: +

+
+ Verify email +
+

+ If you have any trouble, try pasting this link in your browser: + <%= + url.resolve(sails.config.custom.baseUrl,'/verify-email')+'?token='+encodeURIComponent(token) + %> +

+

Sincerely,

+

The Boring JavaScript Stack Team

+``` diff --git a/docs/mail/getting-started.md b/docs/mail/getting-started.md new file mode 100644 index 0000000..cd1e790 --- /dev/null +++ b/docs/mail/getting-started.md @@ -0,0 +1,51 @@ +--- +title: Getting started +editLink: true +next: + text: 'Configuration' + link: '/mail/configuration' +--- + +# {{ $frontmatter.title }} + +## Introduction + +Mail or Sails Mail provides a sleek, elegant, and developer-friendly email API that turns sending emails into a walk in the park for your Sails applications. + +Mail introduces transports for sending emails via SMTP, Resend, etc which allows you to quickly and elegantly get started sending emails through any local or cloud-based email service of your choice. + +## Installation + +### Prerequisites + +- [Node.js](https://nodejs.org) version 18 or higher +- [Sails](https://sailsjs.com) version 1 or higher + +To install Mail, simply run the following command in your Sails project: + +```sh [npm] +$ npm install sails-hook-mail +``` + +## Usage + +Mail exposes a `send` [helper](https://sailsjs.com/documentation/concepts/helpers) that you can call in your Sails actions or where ever you have access to helpers in your Sails application. + +For example we can send an email verification email when a user signs up successfully via a `user/signup.js` action: + +```js +// controllers/user/signup.js +await sails.helpers.mail.send.with({ + subject: 'Verify your email', + template: 'email-verify-account', + to: unverifiedUser.email, + templateData: { + token: unverifiedUser.emailProofToken, + fullName: unverifiedUser.fullName + } +}) +``` + +You can already see a couple of the arguments you can pass to the send helper provided by Mail. + +Next, You can check out all the various supported [transports](/mail/transports) Mail provide for you to send your emails and how to configure them diff --git a/docs/mail/index.md b/docs/mail/index.md new file mode 100644 index 0000000..ad0e0d2 --- /dev/null +++ b/docs/mail/index.md @@ -0,0 +1,23 @@ +--- +layout: home +hero: + name: Mail + tagline: The simple elegant way to send emails from a Sails applications. + actions: + - theme: brand + text: Get Started + link: /mail/getting-started + - theme: alt + text: View on GitHub + link: https://github.com/sailscastshq/sails-hook-mail +features: + - icon: 👨🏾‍💻 + title: Easy setup + details: Sails Mail provides an amazing and elegant API for sending emails. + - icon: 🚚 + title: Multiple transports + details: Supports SMTP, Resend, log, and more transports, to allow you use your favorite email service without any stress. + - icon: 🛠️ + title: Flexible configuration + details: Need multiple email transports or mailers in the same Sails project? Mail make that a breeze to do. +--- diff --git a/docs/mail/local-development.md b/docs/mail/local-development.md new file mode 100644 index 0000000..178cbf3 --- /dev/null +++ b/docs/mail/local-development.md @@ -0,0 +1,32 @@ +--- +title: Local development +editLink: true +prev: + text: 'Resend Transport' + link: '/mail/resend-transport' +--- + +# {{ $frontmatter.title }} + +When creating an application that involves sending emails, you likely wouldn't want to send actual emails to active email addresses during local development. + +Sails Mail offers various methods to "deactivate" the real email sending process for local development purposes. + +## Log Transport + +During development you may set a mailer with the log transport which will log the content of your email to the console. + +```js +// config/mail.js +mailers: { + log: { + transport: 'log' + } +} +``` + +## Mailtrap / NodemailerApp + +Another option is to utilize services like [Mailtrap](https://mailtrap.io/email-sandbox/) or [NodemailerApp](https://nodemailer.com/app/) along with the [SMTP transport](/mail/smtp-transport) to route your email messages to a simulated mailbox. + +This enables you to examine the emails within an email client, such as Mailtrap's or NodemailerApp's message viewer. diff --git a/docs/mail/resend-transport.md b/docs/mail/resend-transport.md new file mode 100644 index 0000000..ba0f6ca --- /dev/null +++ b/docs/mail/resend-transport.md @@ -0,0 +1,75 @@ +--- +title: Resend Transport +editLink: true +prev: + text: 'SMTP Transport' + link: '/mail/smtp-transport' +next: + text: 'Local Development' + link: '/mail/local-development' +--- + +# {{ $frontmatter.title }} + +To use the [Resend](https://resend.com) transport, install `resend` via NPM: + +```sh +npm i resend --save +``` + +Next, setup a mailer in the `mailers` object in `config/mail.js`, the name of the mailer can be anything but you can use `smtp` as well: + +```js +// config/mail.js +mailers: { + resend: { + transport: 'resend' + } +} +``` + +Also set the `default` option in `config/mails.js` to `resend` or whatever name you call the mailer above. + +```js +// config/mails.js +default: 'resend' +``` + +## Resend credentials + +To set the Resend credentials, you have a couple of options: + +## Environment variables + +Set the following environment variables + +```env +RESEND_API_KEY=re_skskagnagnak +``` + +## local.js + +Set an object in `config/local.js` matching the mailer you've set in `config/mails.js`: + +```js +// config/local.js +resend: { + apiKey: 're_skskagnagnak', +} +``` + +## config/mail.js + +You can set your credentials within the mailer defintion as well: + +```js +// config/mail.js +mailers: { + resend: { + transport: 'resend', + apiKey: process.env.RESEND_API_KEY + } +} +``` + +Notice that for the `apiKey` in `config/mail.js` we are still using environment variables as its best practice not to add secrets to your codebase. diff --git a/docs/mail/send-helper.md b/docs/mail/send-helper.md new file mode 100644 index 0000000..eeab058 --- /dev/null +++ b/docs/mail/send-helper.md @@ -0,0 +1,141 @@ +--- +title: Send Helper +editLink: true +prev: + text: 'Email Layout' + link: '/mail/email-layout' +next: false +--- + +# {{ $frontmatter.title }} + +Mail provides a `send` helper that is used to send your emails within your Sails applications. The `send` helper takes in several optional and required arguments like `mailer`, `template`, `templateData` etc. + +## mailer + +The mailer to use for sending the email. This is optional because by default Mail will look for the mailer to use by checking for it in the following places: + +- an environment variable called `MAIL_MAILER`, +- a config in `config/local.js` called `mailer`, +- and finally the `default` mailer set in `config/mail.js` + +```js +sails.helpers.mail.send.with({ mailer: 'resend' }) +``` + +## template required + +This is a string matching an [email template](/mail/email-template) in `views/emails` without the file extension. + +```js +sails.helpers.mail.send.with({ template: 'email-verify-account' }) +``` + +## templateData + +A dictionary of data which will be accessible in your email template. + +```js +sails.helpers.mail.send.with({ templateData: { fullName: 'Jack Sparrow' } }) +``` + +## to required + +The email address of the primary recipient. + +```js +sails.helpers.mail.send.with({ to: 'jack@blackpearl.com' }) +``` + +## toName + +The name of the primary recipient + +```js +sails.helpers.mail.send.with({ toName: 'Jack Sparrow' }) +``` + +## subject + +The subject of the email. + +```js +sails.helpers.mail.send.with({ subject: 'Verify email' }) +``` + +## from + +The from email to use to send the email. This isn't required because you can specify a [global from](/mail/configuration#from) + +```js +sails.helpers.mail.send.with({ from: 'boring@sailscasts.com' }) +``` + +## fromName + +The from name to use to send the email. This isn't required because you can specify a [global from](/mail/configuration#from) + +```js +sails.helpers.mail.send.with({ fromName: 'The Boring JavaScript Stack' }) +``` + +## layout + +The email layout to use for this email. This isn't required because by default Mail will look for a layout called `layout-email`. + +However with `layout` you can pass an override and chose another layout to use or you can disable layout by passing `false` + +### Specify a layout + +```js +await sails.helpers.mail.send.with({ layout: 'layout-accout' }) +``` + +### Disable layout + +```js +await sails.helpers.mail.send.with({ layout: false }) +``` + +## text + +Specify email plain text. + +```js +await sails.helpers.mail.send.with({ text: 'Verify your email' }) +``` + +## Examples + +### Send email with template + +```js +await sails.helpers.mail.send.with({ + to: 'jack@blackpearl.com', + toName: 'Jack Sparrow', + template: 'email-verify-account', + templateData: { token: '3828bsbababvbas', fullName: 'Jack Sparrow' } +}) +``` + +### Disable layout + +```js +await sails.helpers.mail.send.with({ + to: 'jack@blackpearl.com', + toName: 'Jack Sparrow', + template: 'email-verify-account', + templateData: { token: '3828bsbababvbas', fullName: 'Jack Sparrow' }, + layout: false +}) +``` + +### Send plain text email + +```js +await sails.helpers.mail.send.with({ + to: 'jack@blackpearl.com', + toName: 'Jack Sparrow', + text: 'Hello Jack, how is the black pearl' +}) +``` diff --git a/docs/mail/smtp-transport.md b/docs/mail/smtp-transport.md new file mode 100644 index 0000000..465479b --- /dev/null +++ b/docs/mail/smtp-transport.md @@ -0,0 +1,84 @@ +--- +title: SMTP Transport +editLink: true +prev: + text: 'Transports' + link: '/mail/transports' +next: + text: 'Resend Transport' + link: '/mail/resend-transport' +--- + +# {{ $frontmatter.title }} + +To use the SMTP transport, which is a protocol several email services supports, install `nodemailer` via NPM: + +```sh +npm i nodemailer --save +``` + +Next, setup a mailer in the `mailers` object in `config/mail.js`, the name of the mailer can be anything but you can use `smtp` as well: + +```js +// config/mail.js +mailers: { + smtp: { + transport: 'smtp' + } +} +``` + +Also set the `default` option in `config/mails.js` to `smtp` or whatever name you call the mailer above. + +```js +// config/mails.js +default: 'smtp' +``` + +## SMTP credentials + +To set the SMTP credentials, you have a couple of options: + +## Environment variables + +Set the following environment variables + +```env +MAIL_HOST=sandbox.smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=username +MAIL_PASSWORD=password +``` + +## local.js + +Set an object in `config/local.js` matching the mailer you've set in `config/mails.js`: + +```js +// config/local.js +smtp: { + host: 'sandbox.smtp.mailtrap.io', + username: 'username', + password: 'password', + port: 2525 +} +``` + +## config/mail.js + +You can set your credentials within the mailer defintion as well: + +```js +// config/mail.js +mailers: { + smtp: { + transport: 'smtp', + host: 'sandbox.smtp.mailtrap.io', + username: process.env.MAIL_USERNAME, + password: process.env.MAIL_PASSWORD, + port: 2525 + } +} +``` + +Notice that for the `username` and `password` credentials we are still using environment variables as its best practice not to add secrets to your codebase. diff --git a/docs/wish/github.md b/docs/wish/github.md index 7f7e3be..c163207 100644 --- a/docs/wish/github.md +++ b/docs/wish/github.md @@ -5,7 +5,7 @@ editLink: true # {{ $frontmatter.title }} -To setup up a GitHub OAuth for your app, `wish` expects the following key and property in either `config/local.js` or `config/custom.js`. For example you can have a development GitHub clientId and clientSecret in `config/local.js` +To setup up a GitHub OAuth for your app, Wish expects the following key and property in either `config/local.js` or `config/custom.js`. For example you can have a development GitHub clientId and clientSecret in `config/local.js` ```js // config/local.js @@ -71,7 +71,7 @@ Notice the redirect is a one-line of code and when this action is called, it wil ## The callback -Note the callback URL we set above that `wish` will callback? Let's also implement that starting from the route in `routes.js` +Note the callback URL we set above that Wish will callback? Let's also implement that starting from the route in `routes.js` ```js 'GET /auth/callback': 'auth/callback', @@ -152,6 +152,6 @@ module.exports = { } ``` -The above is an actual real world use case of wish in [https://sailscasts.com](https://sailscasts.com). You can perform any business logic you want. +The above is an actual real world use case of Wish in [https://sailscasts.com](https://sailscasts.com). You can perform any business logic you want. There you have it, a GitHub OAuth flow with just two routes and one line of code each to both redirect to GitHub and get the OAuth user details. diff --git a/docs/wish/google.md b/docs/wish/google.md index 89ff9af..354d3b2 100644 --- a/docs/wish/google.md +++ b/docs/wish/google.md @@ -5,10 +5,9 @@ editLink: true # {{ $frontmatter.title }} +To setup up a Google OAuth for your app, Wish expects the following key and property in either `config/local.js` or `config/custom.js`. -## Google - -To setup up a Google OAuth for your app, `wish` expects the following key and property in either `config/local.js` or `config/custom.js`. For example you can have a development Google `clientId` and `clientSecret` in `config/local.js` +For example you can have a development Google `clientId` and `clientSecret` in `config/local.js` > Do make sure to get the needed `clientId` and `clientSecret` credentials from the Google Console. You can see [here](https://developers.google.com/identity/protocols/oauth2) for instructions on how to get those credentials @@ -33,7 +32,7 @@ google: { > Notice I am using environment variables as it's best practice not to commit your secret credentials. In the case of `local.js` that's okay because that file is never committed to version control. -### The redirect +## The redirect A typical flow is to have a button on your website say like "Sign in with Google". A good example is implemented in [The Boring JavaScript Stack](https://sailscasts.com/boring) mellow template @@ -55,13 +54,13 @@ module.exports = { exits: { success: { - responseType: 'redirect', - }, + responseType: 'redirect' + } }, fn: async function () { return sails.wish.provider('google').redirect() - }, + } } ``` @@ -69,7 +68,7 @@ Notice the redirect is a one-line of code and when this action is called, it wil ## The callback -Note the callback URL we set above that `wish` will callback? Let's also implement that starting from the route in `routes.js` +Note the callback URL we set above that Wish will callback? Let's also implement that starting from the route in `routes.js` ```js 'GET /auth/callback': 'auth/callback', @@ -84,14 +83,14 @@ module.exports = { inputs: { code: { type: 'string', - required: true, - }, + required: true + } }, exits: { success: { - responseType: 'redirect', - }, + responseType: 'redirect' + } }, fn: async function ({ code }, exits) { @@ -109,7 +108,7 @@ module.exports = { name: googleUser.name, googleAvatarUrl: googleUser.picture, googleAccessToken: googleUser.accessToken, - googleIdToken: googleUser.idToken, + googleIdToken: googleUser.idToken } ).exec(async (error, user, wasCreated) => { if (error) throw error @@ -118,31 +117,31 @@ module.exports = { // And then update the email change candidate which will be used be used to prompt the user to update their email if (!wasCreated && user.email !== googleUser.email) { await User.updateOne({ id: user.id }).set({ - emailChangeCandidate: googleUser.email, + emailChangeCandidate: googleUser.email }) } if (!wasCreated && user.name !== googleUser.name) { await User.updateOne({ id: user.id }).set({ - name: googleUser.name, + name: googleUser.name }) } if (!wasCreated && user.googleAvatarUrl !== googleUser.picture) { await User.updateOne({ id: user.id }).set({ - googleAvatarUrl: googleUser.picture, + googleAvatarUrl: googleUser.picture }) } if (!wasCreated && user.googleAccessToken !== googleUser.accessToken) { await User.updateOne({ id: user.id }).set({ - googleAccessToken: googleUser.accessToken, + googleAccessToken: googleUser.accessToken }) } if (!wasCreated && user.googleIdToken !== googleUser.idToken) { await User.updateOne({ id: user.id }).set({ - googleIdToken: googleUser.idToken, + googleIdToken: googleUser.idToken }) } @@ -151,7 +150,7 @@ module.exports = { req.session.userId = user.id return exits.success('/') }) - }, + } } ``` diff --git a/docs/wish/index.md b/docs/wish/index.md index ad9d3ed..c4434da 100644 --- a/docs/wish/index.md +++ b/docs/wish/index.md @@ -6,7 +6,7 @@ features: - title: Support for popular OAuth flows details: GitHub, Google, Twitter(coming soon) hero: - name: wish + name: Wish text: The OAuth hook you wish exists for Sails tagline: Easily setup OAuth flows in your Sails applications. actions: diff --git a/docs/wish/what-is-wish.md b/docs/wish/what-is-wish.md index f85a694..b1912f5 100644 --- a/docs/wish/what-is-wish.md +++ b/docs/wish/what-is-wish.md @@ -1,12 +1,23 @@ --- -title: What is wish? +title: What is Wish? editLink: true --- # {{ $frontmatter.title }} -wish is the OAuth Sails hook you wish(pun intended) exists for Sails. wish provides a simple, convenient way to authenticate with OAuth providers. wish currently supports authentication via GitHub +Wish is the [OAuth](https://en.wikipedia.org/wiki/OAuth) Sails hook you wish(pun intended) exists for Sails. + +Wish provides a simple, convenient way to authenticate with OAuth providers. + +Wish supports [OAuth 2.0](https://oauth.net/2/) authentication and authorization via: + +- [GitHub](/wish/github) +- [Google](/wish/google) ## Motivation -When building [sailscasts](https://sailscasts.com), I needed an OAuth flow for GitHub. This hook is a byproduct of how OAuth is used in Sailscasts and it's targetted to not letting you reinvent the wheel and just use this hooks when you want to support OAuth in your Sails applications. +When building [Sailscasts](https://sailscasts.com), I needed an OAuth flow for to allow Sailscasts users to log in via GitHub. + +So I wrote Wish as a Sails hook. This hook is an outcome of observing OAuth implementation in Sailscasts, aiming to spare you from writing the entire OAuth logic yourself. + +Its primary purpose is to simplify supporting OAuth 2.0 authentication and authorization in Sails applications. diff --git a/package.json b/package.json index 1cf902b..eb9d5cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sailscasts-docs", - "version": "1.0.4", + "version": "1.0.5", "private": true, "description": "The official docs hub for Sailscasts", "scripts": {