-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
review auth controller code #154
Conversation
Github CI fails because the environment variables are not defined: AUTH_API_KEY: ${{ secrets.AUTH_API_KEY }}
ADMIN_EMAIL: [email protected]
EMAIL_APP_URL: ${{ secrets.EMAIL_APP_URL }}
ENCRYPTION_KEYS: ${{ secrets.ENCRYPTION_KEYS }}
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
SECRET_KEY_BASE: ${{ secrets.SECRET_KEY_BASE }} I've added as secrets in the Github repository environments but I must misunderstand how to load them in the CI action. Reading the Github doc to see if I missed anything. |
After watching https://www.youtube.com/watch?v=5XfgT9A9PHw&ab_channel=MickeyGousset jobs:
build:
name: Build and test
environment: dwylauth
runs-on: ubuntu-latest |
Codecov Report
@@ Coverage Diff @@
## main #154 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 545 529 -16
=========================================
- Hits 545 529 -16
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonLab update looks good. 👍
LMK if you think it's ready to merge. Thanks.
@@ -467,14 +445,17 @@ defmodule AuthWeb.AuthController do | |||
end | |||
|
|||
def verify_email(conn, params) do | |||
id = Auth.Apikey.decode_decrypt(params["id"]) | |||
{:ok, id} = Auth.Apikey.decode_decrypt(params["id"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if this decode_decrypt
fails? 💭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, I'll add a case to manage the {:errror, _}
returned value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nelsonic I've updated the function and added test. PR ready for review again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref: #153
Update mostly the auth controller. I've tried to make it a bit more easy to navigate between functions to make it easier to understand the authentication workflow