lib/finapps/rest/sessions.rb in finapps-5.0.34 vs lib/finapps/rest/sessions.rb in finapps-5.0.35
- old
+ new
@@ -13,18 +13,11 @@
path ||= CONSUMER_LOGIN
begin
super params, path
rescue FinAppsCore::ApiUnauthenticatedError
- (
- [
- nil,
- [
- "Invalid #{path == CONSUMER_LOGIN ? 'Consumer' : 'Operator'} Identifier or Credentials"
- ]
- ]
- )
+ login_error(path)
end
end
def destroy
create nil, LOGOUT
@@ -33,9 +26,18 @@
private
def validates(params)
params.key?(:email) && params[:email] && params.key?(:password) &&
params[:password]
+ end
+
+ def login_error(path)
+ [
+ nil,
+ [
+ "Invalid #{path == CONSUMER_LOGIN ? 'Consumer' : 'Operator'} Identifier or Credentials"
+ ]
+ ]
end
end
end
end