bas652

bas652

Code review for authentication flow

Hi Everyone!

I’m still new to the Elixir and Phoenix world, so I’m trying to make an API as a learning project, but in the end I got a bit confused while trying to work out an authentication flow with Guardian. In the end I managed to create a working prototype (without token revocation but I plan on building it later), but I am not sure if my code follows best practices, and would love some advice if someone is willing to review it. The most confusing thing was the pipeline and the error handling for me, so if somebody takes a look on that, that’s a great help already

All feedback is greatly appreciated! I made a PR for myself on github, you can take a look at it here:
https://github.com/blascsi/redoist-backend/pull/1

Most Liked

OvermindDL1

OvermindDL1

Guardian is designed for tokens specifically that don’t hit the database, I.E. it makes no sense for it to have revocation, rather a very short timeout between non-communicating servers is their general use, not single server API’s. It sounds like you just want to use normal Phoenix.Token’s.

siddhant3030

siddhant3030

Where Next?

Popular in Questions Top

ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 130579 1222
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54092 488
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

We're in Beta

About us Mission Statement