Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Flesh out the docs on adonis-ally #273

Open
johnpyp opened this issue Jun 4, 2018 · 0 comments
Open

Flesh out the docs on adonis-ally #273

johnpyp opened this issue Jun 4, 2018 · 0 comments
Assignees

Comments

@johnpyp
Copy link
Contributor

johnpyp commented Jun 4, 2018

I recently started with adonis, and the first thing I wanted to do was get some kind of social authentication going, and there were a few pain points that took me a while to solve and I think would be valuable additions to the social auth docs.

  1. I think it would be useful to go over specifically what you need to setup your database to handle user authentication. A basic review covering just the barebones users migration and user model (noting it can be empty and still work). I feel like the docs are lacking in this regard, repetition isn't used as much as it could to improve understanding.

  2. Add in the common use case of an already-logged-in guard to the "basic example", something like this:

      try {
        await auth.check()
      } catch (error) {
        await auth.login(user)
      }
  1. Add a "show/getUser" method to the example, showing how to retrieve the current user once you are authenticated, like this:
  async show({ auth, params }) {
    try {
      let user = await auth.getUser()
      return { status: true, data: user }
    } catch (e) {
      return { status: false, data: 'Not Logged In' }
    }
  }
  1. Add a note about the session config option sameSite. I don't know if this is a consistent issue, but using google auth I had a huge issues and I had no idea about this until I found an obscure issue regarding it.

  2. Add an example about the remember(true) setting, because it seems to need a token model and migration setup with the user. I still haven't figured out how to set this up, though I didn't need it that badly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants