Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Created June 9, 2018 23:31
Show Gist options
  • Save jordanhudgens/d3bf81b4ef077809537f04748df8081e to your computer and use it in GitHub Desktop.
Save jordanhudgens/d3bf81b4ef077809537f04748df8081e to your computer and use it in GitHub Desktop.
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