Created
June 9, 2018 23:31
-
-
Save jordanhudgens/d3bf81b4ef077809537f04748df8081e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RegistrationsController < ApplicationController | |
include AuthTokenConcern | |
def create | |
user = User.create!( | |
email: params['user']['email'], | |
password: params['user']['password'], | |
password_confirmation: params['user']['password_confirmation'], | |
auth_token: unique_auth_token | |
) | |
if user | |
session[:user_id] = user.id | |
render json: { status: :created } | |
else | |
render json: { status: 500 } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment