Skip to content
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

refactor: Replace Addict with Guardian #126

Merged
merged 44 commits into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9ede0a0
fix: Remove addict
pmrukot Sep 14, 2017
451d417
Initial version
pmrukot Oct 6, 2017
c5973ea
Make sockets auth work
pmrukot Oct 8, 2017
76869a6
Resolve get_user function ambiguity
pmrukot Oct 9, 2017
7ce9bcf
Prepare for Registration form
pmrukot Oct 9, 2017
eb615ba
Initial register form
pmrukot Oct 9, 2017
fa851cc
Working version of registration
pmrukot Oct 10, 2017
44b191a
Fetch resources after login
pmrukot Oct 10, 2017
70af621
Make local storage work
pmrukot Oct 10, 2017
0267611
Try to init socket connection when app starts
pmrukot Oct 11, 2017
0847393
Make /api/me work again, prototype of request with tokens
pmrukot Oct 11, 2017
4162852
Make authenticated request to api/me
pmrukot Oct 11, 2017
257c7c0
Delete unused code
pmrukot Oct 11, 2017
3a88577
Remove temp function
pmrukot Oct 11, 2017
fc58275
Add logout
pmrukot Oct 11, 2017
98d1f9b
Prevent errors on /api/me
pmrukot Oct 11, 2017
ef1a587
Protect sources from unauthorised request, add token to requests on E…
pmrukot Oct 11, 2017
d77d2ee
Merge branch 'master' into refactor/replace-addict-with-guardian
pmrukot Oct 11, 2017
c83aa0a
Make credo happy
pmrukot Oct 11, 2017
68ee096
Make tests run again
pmrukot Oct 11, 2017
bd67156
Make tests work again
pmrukot Oct 11, 2017
65bda44
Add guardian setup to travis.exs
pmrukot Oct 12, 2017
4c29c1c
Fix indentation
pmrukot Oct 12, 2017
e44b890
Update mix.lock
mrapacz Oct 12, 2017
a2b7fb5
Add room_channel warnings to dialyzer warning file
mrapacz Oct 12, 2017
1d11759
Fix dialyzer reports
mrapacz Oct 12, 2017
5dfe8ba
Uncomment bundle.js
mrapacz Oct 13, 2017
784c2e9
Update dialyzer warnings
pmrukot Oct 13, 2017
0fa39b5
Centralize config
pmrukot Oct 13, 2017
393a685
Remove unused functions
pmrukot Oct 13, 2017
710b270
Reset location after login
pmrukot Oct 13, 2017
4003044
Don't hardcode url
pmrukot Oct 13, 2017
3a491e2
Add notification when login fails
pmrukot Oct 13, 2017
a273c89
Remove wrong import
pmrukot Oct 13, 2017
c806c54
Login user after register
pmrukot Oct 13, 2017
a82a276
Fix post auth actions
pmrukot Oct 13, 2017
98fd3c1
Move socket initialisation to Socket.elm
pmrukot Oct 13, 2017
febdfe7
Review adjustments
pmrukot Oct 16, 2017
0d5758c
Extract controller errors
mrapacz Oct 16, 2017
9373229
Move setup to conn_case.ex
pmrukot Oct 17, 2017
22061f5
Make two separate ConnCase s
pmrukot Oct 17, 2017
dff20f6
Add login tests
pmrukot Oct 17, 2017
b7c14d4
Refactor login tests
pmrukot Oct 17, 2017
8927b8f
Add more test to authorization
pmrukot Oct 17, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion aion/web/elm/src/Auth/Notifications.elm
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,13 @@ registrationErrorToast =

registrationSuccessfulToast : ( Model, Cmd Msg ) -> ( Model, Cmd Msg )
registrationSuccessfulToast =
addToast (Toasty.Defaults.Success "Success!" "Account created successfuly - proceed to Login.")
addToast (Toasty.Defaults.Success "Success!" "Account created successfuly.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

successfully




-- login notifications


loginErrorToast : ( Model, Cmd Msg ) -> ( Model, Cmd Msg )
loginErrorToast =
addToast (Toasty.Defaults.Error "Error!" "Failed to login :(")
6 changes: 4 additions & 2 deletions aion/web/elm/src/Update.elm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Update exposing (..)

import Auth.Api exposing (registerUser, submitCredentials)
import Auth.Notifications exposing (registrationErrorToast, registrationSuccessfulToast)
import Auth.Notifications exposing (loginErrorToast, loginSuccessfulToast, registrationErrorToast, registrationSuccessfulToast)
import Dom exposing (focus)
import Forms
import General.Constants exposing (loginFormMsg, registerFormMsg)
Expand Down Expand Up @@ -80,7 +80,9 @@ update msg model =
]

Err err ->
{ model | authData = { oldAuthData | msg = toString err } } ! []
{ model | authData = { oldAuthData | msg = toString err } }
! []
|> loginErrorToast

Register ->
model ! [ registerUser model.location model.authData.registrationForm ]
Expand Down