Comments (24)
ping @koistya
mind answering this one?
from react-starter-kit.
@frankleng I'm going to include auth flow example into this kit, hopefully next week.
from react-starter-kit.
@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.
@koistya I'm also trying to learn how to implement auth with React, would love an example.
from react-starter-kit.
+1
from react-starter-kit.
The nuclearmail app (https://github.com/ianobermiller/nuclearmail) has a working example of auth using the Gmail REST API
from react-starter-kit.
@koistya An example of auth with react-router would be great, have you had any more look into this?
from react-starter-kit.
+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.
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.
@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.
@constantx fixed 'How to implement routing' recipe in 9891699
from react-starter-kit.
@koistya rad, will check it out
from react-starter-kit.
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.
@constantx one way is to use Location.navigateTo('/new-path')
from react-starter-kit.
Another way.. is to add this redirect logic to the router, I will try to do it later
from react-starter-kit.
@koistya rad, looking forward to it, thanks for all the hard work!
from react-starter-kit.
@koistya, awesome work thanks. I agree it would be great to have an auth example route in the kit.
from react-starter-kit.
@koistya Would also love an auth example route.
from react-starter-kit.
+1
from react-starter-kit.
Could be great ! +1
from react-starter-kit.
@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.
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.
@constantx @9mm @gmlnchv @lovegroveandy @ACPK
this is not a PR, but i pubish my fork with:
- redirects (server and client)
- authorization
- 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.
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)
- Need help building an old website from 2016 HOT 5
- Error 500: Unexpected token < in JSON at position 0 HOT 3
- SPAM
- 'Cannot find module' Error for cached modules in VSCode HOT 1
- Minor issue running 'Relay' with Yarn HOT 1
- Cannot find module ... TypeScript error in VSCode HOT 1
- Hot Reload not working properly HOT 1
- Hot Reload CSS and JS files changes HOT 1
- Cannot open started application due to Firebase error HOT 2
- site.manifest error - comma missing
- What kind of API token templates should I use? HOT 1
- Where's node_modules?
- Where's node_modules? HOT 1
- Error on first start. TT HOT 2
- Network: use --host to expose HOT 1
- Codespaces not working with "Use Template" (workaround: clone/fork/duplicate repo) HOT 5
- The engine "node" is incompatible with this module. Expected version "10". Got "18.14.0" HOT 5
- Shipping with Google_Cloud_Credentials Issue HOT 2
- Login Dialog is not showing up
- Unable to add packages using Yarn HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-starter-kit.