Skip to content

Commit

Permalink
feat: sets a session id in the user create action
Browse files Browse the repository at this point in the history
  • Loading branch information
noahdurbin committed Aug 22, 2024
1 parent 6c97cfb commit 8c03390
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/api/v1/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class Api::V1::UsersController < ApplicationController
def create
user = User.new(user_params)
if user.save
session[:user_id] = user.id
render json: UserSerializer.new(user), status: :created
else
render json: ErrorSerializer.new(user, :unprocessable_entity).serialize, status: :unprocessable_entity
Expand Down

0 comments on commit 8c03390

Please sign in to comment.