Git Product home page Git Product logo

blackode / guardian_auth Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 3.0 84 KB

The Guardian Authentication Implementation Using Ecto/Postgresql Elixir Phoenix [ User Authentication ]

JavaScript 8.24% CSS 0.09% Elixir 82.12% HTML 9.54%
authentication guardian login-system login-automation login-auth elixir-lang elixir guardian-authentication simple phoenix-framework phoenix user-auth user-authentication postgresql postgresql-database postgres guardian-authentication-simple sessions user-sessions signin

guardian_auth's Introduction

GuardianAuth

This is the working example of ** Guardian Authentication ** implemented using the ** Postgresql ** database. In this example I am using the default localhost for live authentication for live database.

Features

  • User Registrations Listing Editing and Deleting
  • User Sessions Creation/Deletion
  • If the new user is created, a session is automatically created and treating that user as a logged in user automatically.
  • Authentication Url Redirection.

If the user try to visit the unauthorized urls with out logging in then he is redirected to login page. If he already logged in and trying to visit login page, if the token is still exists, he is redirected to authenticated users.

Technologies

The following are the versions used at the time of writing this template.

  • Elixir 1.5.1
  • Erlang 20.0
  • Phoenix 1.3.0

Authentication Elixir Modules

  • Guardian ~> 0.14
  • bcrypt_elixir ~> 1.0
  • comeonin ~> 4.0

** NOTE ** For bcrypt_elixir version 1.0, you need to be using Erlang 20.0
Downgrade to bcrypt_elixir version 0.12, if you use the older version of the Erlang 19.

Usage

You can use this as an Authentication Template or Boilerplate and start focussing on your development instead of spending time in writing user signin and signout.
Just clone it using the url https://github.com/blackode/guardian_auth.git and change the MODULE NAMES and APP_NAMES according to your project.

Starting Server

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Install Node.js dependencies with cd assets && npm install
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

Buy me a Coffee if this is useful Thanks for Reading.

https://paypal.me/ankanna

guardian_auth's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.