2020-03-07 23:32:07 +01:00
|
|
|
class SignUp::Create < BrowserAction
|
2020-03-07 05:39:00 +01:00
|
|
|
include Auth::RedirectSignedInUsers
|
|
|
|
|
|
|
|
route do
|
|
|
|
SignUpUser.create(params) do |operation, user|
|
|
|
|
if user
|
|
|
|
flash.info = "Thanks for signing up"
|
|
|
|
sign_in(user)
|
|
|
|
redirect to: Home::Index
|
|
|
|
else
|
|
|
|
flash.info = "Couldn't sign you up"
|
|
|
|
html NewPage, operation: operation
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|