https://github.com/librity/ignite_jwt_ttl
Rocket Seat - Ignite - Elixir - Challenge 14 - An authenticated API made with Phoenix and Guardian.
https://github.com/librity/ignite_jwt_ttl
challenge elixir guardian phoenix rocketseat-ignite
Last synced: 15 days ago
JSON representation
Rocket Seat - Ignite - Elixir - Challenge 14 - An authenticated API made with Phoenix and Guardian.
- Host: GitHub
- URL: https://github.com/librity/ignite_jwt_ttl
- Owner: librity
- Created: 2021-04-07T03:14:02.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-25T12:00:36.000Z (over 4 years ago)
- Last Synced: 2025-11-18T22:16:15.737Z (7 months ago)
- Topics: challenge, elixir, guardian, phoenix, rocketseat-ignite
- Language: Elixir
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rocket Seat Ignite - JWT Authentication
## Table of Contents
- [About](#about)
- [Endpoints](#endpoints)
- [Setup](#setup)
- [Bash Commands](#bash_commands)
- [Elixir Commands](#elixir_commands)
- [Libs](#libs)
- [Docs](#docs)
- [Resources](#resources)
An authenticated API made with Phoenix and Guardian.
Built-in:
- `GET` http://localhost:4000/dashboard
`Users`
- `POST` http://localhost:4000/api/users
- `POST` http://localhost:4000/api/users/sign_in
`Repos`
- `GET` http://localhost:4000/api/repos/:username
Install `Erlang`, `Elixir` and `Phoenix`.
```bash
# Create phoenix app without webpacker or html views
$ mix phx.new app_name --no-webpack --no-html
# Intall dependencies
$ mix deps.get
# Compile project
$ mix compile
# Generate linter config file
$ mix credo.gen.config
# Run linter
$ mix credo --strict
# Start Phoenix dev server on http://localhost:4000
$ mix phx.server
# Start your project as an Interactive Elixir session
$ iex -S mix
# List all configured routes
$ mix phx.routes
```
Tests
```bash
# Run tests
$ mix test
# Run tests w/ coverage report
$ mix test --cover
```
Github client:
```elixir
> Github.Client.get_user_repos("teamon")
> Github.Client.get_user_repos("danilo-vieira")
> Github.Client.get_user_repos("librity")
```
- https://github.com/phoenixframework/phoenix
- https://github.com/teamon/tesla
- https://github.com/PSPDFKit-labs/bypass
- https://github.com/dashbitco/mox
- https://github.com/thoughtbot/ex_machina
- https://github.com/riverrun/pbkdf2_elixir
- https://github.com/ueberauth/guardian
- https://elixir-lang.org/crash-course.html
- https://hexdocs.pm/guardian/Guardian.html#encode_and_sign/4
- https://hexdocs.pm/guardian/Guardian.Token.Jwt.html#refresh/3
- https://www.tutorialspoint.com/elixir/elixir_lists_and_tuples.htm
- https://stackoverflow.com/questions/29566248/how-to-use-io-inspect-on-a-long-list-without-trimming-it
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent