Project

authmotion

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
you can authenticate a user this gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0
 Project Readme

authmotion

Installation

Add this line to your application's Gemfile:

gem 'authmotion'

And then execute:

$ bundle

Or install it yourself as:

$ gem install authmotion

##How use it for login?

class LoginController < UIViewController
 include Auth::EmailLogin
 
 def viewDidLoad
    #anything here... should be your form
 end

 ## You need define how get this fields, in this example i guess that the
 ## inputs should be @email and @password  
 def user_field
   @email 
 end

 def password_field
   @password
 end

 #  format data for send to server
 def data_login_user
   {user:{login: @email.text, password:@password.text}}
 end

 # URL connection for login
 def url_log_in
   "http://auth-motion-server.herokuapp.com/users/login"
 end

 #  Wating actions. In this app you'll see a background and an animation
 def waiting_view
   @background = WaitingView.create
   view.addSubview(@background)
 end

 def hide_waiting_view
   @background.removeFromSuperview
 end
 
 def success_conection_login
   lambda{ |response| "PUTS YOUR ACTIONS HERE" }
 end
end

case test

  • {user: login, password: 123456}

##How use it for Register?

class LoginController < UIViewController
 include Auth::EmailLogin
 
 def viewDidLoad
    #anything here... should be your form
 end

 ## You need define how get this fields,
 ## in this example i guess that the inputs should be @email, @password,@password_confirmation  
 def user_field
   @email 
 end

 def password_field
   @password
 end
 
 def password_confirmation_field
   @password_confirmation
 end

 #########
 #  format data for send to server

 def data_login_user
   {user:{login: @email.text, password:@password.text, password_confirmation: @password_confirmation.text}}
 end

 # URL connection for register, POST

 def url_log_in
   "http://auth-motion-server.herokuapp.com/users"
 end

 #  Wating actions. In this app you'll see a background and an animation
 def waiting_view
   @background = WaitingView.create
   view.addSubview(@background)
 end

 def hide_waiting_view
   @background.removeFromSuperview
 end
 
 def success_conection_register
   lambda{ |response| "PUTS YOUR ACTIONS HERE" }
 end
end

case test

  • Can register => {user: login, password: 123456, password_password: 123456}
  • Is registered => {user: registered, password: ..., password: ...} any password it's ok
  • Other error, you can test with any user.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request