aboutsummaryrefslogtreecommitdiff
path: root/src/actions/sign_ups/create.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions/sign_ups/create.cr')
-rw-r--r--src/actions/sign_ups/create.cr16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/actions/sign_ups/create.cr b/src/actions/sign_ups/create.cr
new file mode 100644
index 0000000..a291ca6
--- /dev/null
+++ b/src/actions/sign_ups/create.cr
@@ -0,0 +1,16 @@
+class SignUps::Create < BrowserAction
+ include Auth::RedirectSignedInUsers
+
+ post "/sign_up" 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