Coder Social home page Coder Social logo

motion-authentication's People

Contributors

andrewhavens avatar augustosamame avatar xdite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

motion-authentication's Issues

.current_user scope

I am having issues with setting .current_user

When first signing in, everything works fine. However, if the application starts with a user previously logged in, and therefore Auth.signed_in? = true, then Auth.current_user must be set as it is currently false.
I check for this and set it in app_delegate:

app_delegate.rb

 def on_load(app, options)
    if Auth.signed_in?
      ApiClient.update_authorization_header(Auth.authorization_header)
      if Auth.current_user.nil?
        set_current_user
        mp Auth.current_user     # evaluates to nil !!!
      end
      open_authenticated_root
    else
      open SignInScreen.new(nav_bar: true)
    end
  end

  def open_authenticated_root
    open_tab_bar MatchesScreen.new(nav_bar: true), MatchTemplatesScreen.new(nav_bar: true)
  end

  def set_current_user
      ApiClient.client.get "user" do |response|
        if response.success?
          Auth.current_user = User.new(response.object["data"])
        else
          app.alert "Please sign in again"
          open SignInScreen.new(nav_bar: true)
        end
    end
  end


The problem is that despite setting Auth.current_user this way, it is always nil when evaluating right away and is also nil in the authenticated_root screen. It does return the User object just fine in the REPL though. I don't know what I'm doing wrong.

devise-token-auth parameters and responses

Hi. I have forked this repo to use it in my project and notice that the current devise_token_auth strategy does not match the current version (v 0.1.37) of the devise_token_auth gem.
User and Email parameters are POSTed to sign_in url but should not be wrapped in a user hash.
Response will include access-token, uid and client field as Header responses, not as fields in the JSON body.
I think this version may be deprecated?
I will make the necessary updates and send a PR if you're interested in updating this. It's certainly a very useful library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.