master
1module Api
2 module V1
3 class LoginsController < ApplicationController
4 def create
5 @user = User.find_by_email(params[:email])
6 if @user.authenticate(params[:password])
7 render json: { auth_token: @user.authentication_token }
8 else
9 render json: { auth_token: "" }
10 end
11 end
12 end
13 end
14end