Code Monkey home page Code Monkey logo

Comments (24)

frankleng avatar frankleng commented on May 8, 2024

ping @koistya
mind answering this one?

from react-starter-kit.

koistya avatar koistya commented on May 8, 2024

@frankleng I'm going to include auth flow example into this kit, hopefully next week.

from react-starter-kit.

frankleng avatar frankleng commented on May 8, 2024

@koistya that'll be great if you have time this week. also with that said, it'll be nice to have a sample for simple redirects.
One of the pain points is debugging routes on the server side. Please let me know if you have any tips.

from react-starter-kit.

cwshevlin avatar cwshevlin commented on May 8, 2024

@koistya I'm also trying to learn how to implement auth with React, would love an example.

from react-starter-kit.

oliwerhelsen avatar oliwerhelsen commented on May 8, 2024

+1

from react-starter-kit.

dqdinh avatar dqdinh commented on May 8, 2024

The nuclearmail app (https://github.com/ianobermiller/nuclearmail) has a working example of auth using the Gmail REST API

from react-starter-kit.

rosswilson avatar rosswilson commented on May 8, 2024

@koistya An example of auth with react-router would be great, have you had any more look into this?

from react-starter-kit.

alesma avatar alesma commented on May 8, 2024

+1, i spent the whole sunday afternoon trying to get this running, trying to keep my code isomorphic and following the flux architecture without success. I believe this is a deal breaker for many, if anyone already have a working solution to share that would be really handy.

from react-starter-kit.

koistya avatar koistya commented on May 8, 2024

Here is an example of an alternative routing approach:

Implementing React.js routing from scratch (docs/recipe)

Where you can check authentication in several ways:

router.route('/store/checkout', async () => {
  if (!this.user.isAuthenticated) {
    this.throw(401, 'You must be authenticated.');
  } else {
    const data = await http.get('/api/cart/items');
    this.render(require('./components/Checkout'), data);
  }
});
router.route('/store/checkout', authorize('user'), async () => { ... });
/* where `authorize(..)` is just a regular route handler */
router.route('/store/*', async () => { /* check authentication via `this.user` */ })
router.route('/store/checkout', async () => { /* load data, return component to render */ });

from react-starter-kit.

constantx avatar constantx commented on May 8, 2024

@koistya the example code has import Router from './core/Router'; but there's no such file. Where can we find it?

from react-starter-kit.

koistya avatar koistya commented on May 8, 2024

@constantx fixed 'How to implement routing' recipe in 9891699

from react-starter-kit.

constantx avatar constantx commented on May 8, 2024

@koistya rad, will check it out

from react-starter-kit.

constantx avatar constantx commented on May 8, 2024

any tip on handling redirect? I'm having a hard time figuring out where to do it (in a store? action? component?)

from react-starter-kit.

koistya avatar koistya commented on May 8, 2024

@constantx one way is to use Location.navigateTo('/new-path')

from react-starter-kit.

koistya avatar koistya commented on May 8, 2024

Another way.. is to add this redirect logic to the router, I will try to do it later

from react-starter-kit.

constantx avatar constantx commented on May 8, 2024

@koistya rad, looking forward to it, thanks for all the hard work!

from react-starter-kit.

lovegroveandy avatar lovegroveandy commented on May 8, 2024

@koistya, awesome work thanks. I agree it would be great to have an auth example route in the kit.

from react-starter-kit.

ACPK avatar ACPK commented on May 8, 2024

@koistya Would also love an auth example route.

from react-starter-kit.

9mm avatar 9mm commented on May 8, 2024

+1

from react-starter-kit.

DCKT avatar DCKT commented on May 8, 2024

Could be great ! +1

from react-starter-kit.

gmlnchv avatar gmlnchv commented on May 8, 2024

@koistya Any progress on this? A working example of a basic auth workflow - token, cookie, user object handling, would be super beneficial for the kit!

from react-starter-kit.

jaredpalmer avatar jaredpalmer commented on May 8, 2024

I use express middleware to ensure authentication for API endpoints. I also use a higher level component to handle component by component permissions. It was a pain to implement this. Would love to see this project move to react router 1.0.

from react-starter-kit.

Bogdaan avatar Bogdaan commented on May 8, 2024

@constantx @9mm @gmlnchv @lovegroveandy @ACPK
this is not a PR, but i pubish my fork with:

  1. redirects (server and client)
  2. authorization
  3. altjs / flux ( stores, actions, Iso etc.)
    Just for example, and some basic features for personal project "out the box"
    see https://github.com/Bogdaan/react-auth-kit

from react-starter-kit.

langpavel avatar langpavel commented on May 8, 2024

This is really old issue.
Feel free to reopen it if you think it may be useful for someone.

from react-starter-kit.

Related Issues (20)

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.