Skip to content

Commit

Permalink
tidy up markdown in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Apr 30, 2020
1 parent 9c40168 commit ca9b110
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ for authenticated routes.
## Why?

The purpose of this project/repo is to demonstrate how simple
is to integrate **`auth_plug`** into _any_ Phoenix Web App/API.
it is to integrate **`auth_plug`** into _any_ Phoenix Web App/API.

## What?

The most basic example of using **`auth_plug`**
to
to add Authentication to a Phoenix App
and showcase a protected route.


## Who?

This example is for us @dwyl who will be using **`auth_plug`**
in all our projects and more specifically for our
[`App`](https://github.com/dwyl/app).
But we have made it as _generic_ as possible
to show that _anyone_ can use (an instance of the) Auth Service
to add Auth to _any_ app in less than 2 minutes!



Expand All @@ -39,10 +43,12 @@ For more info, see:
https://hexdocs.pm/phoenix/Mix.Tasks.Phx.New.html <br />
> The beauty is that this simple use-case
is identical to the advanced one.
Once you understand these basic principals,
you "grock" how to use `auth_plug` _anywhere_!


Change into the `app` directory (`cd app`)
and open the project in your text editor (or IDE).
and open the project in your text editor (or IDE). <br />
e.g: `atom .`


Expand Down Expand Up @@ -87,7 +93,7 @@ Immediately below this add the following lines of code:
[`/lib/app_web/router.ex#L23-L29`](https://github.com/dwyl/auth_plug_example/blob/8ce0f10e656b94a93b8f02af240b3897ce23c006/lib/app_web/router.ex#L23-L29)


#### _Explanation_
#### _Explanation_

There are two parts to this code:

Expand Down Expand Up @@ -118,12 +124,14 @@ Directly below it, add the following code:
end
```

> E.g:
[`/lib/app_web/controllers/page_controller.ex#L8-L10`](https://github.com/dwyl/auth_plug_example/blob/e0e31dbf341f4b8877bca0a9ec846b538e04406a/lib/app_web/controllers/page_controller.ex#L8-L10)


This just means when the `admin/2` function is invoked,
render the `admin.html` template.
render the `admin.html` template. <br />
Speaking of which, let's create it!

> E.g:
[`/lib/app_web/controllers/page_controller.ex#L8-L10`](https://github.com/dwyl/auth_plug_example/blob/e0e31dbf341f4b8877bca0a9ec846b538e04406a/lib/app_web/controllers/page_controller.ex#L8-L10)


### 5. Create the `admin.html.eex` Template
Expand Down

0 comments on commit ca9b110

Please sign in to comment.