GithubHelp home page GithubHelp logo

zaichaopan / laravel-react-spa Goto Github PK

View Code? Open in Web Editor NEW
98.0 7.0 26.0 2.44 MB

A Laravel-React SPA starter project template.

PHP 99.16% HTML 0.84%
react react-router spa jwt laravel hooks context

laravel-react-spa's Issues

Empty POST response?

Hey there! I'm a bit new to Laravel and sculpting REST APIs (so thanks for bearing with me on this issue) but for some reason, when making POST requests to the /api/register endpoint in Postman โ€” I'm getting an empty response and nothing is getting created in the database?

Screen Shot 2019-05-18 at 8 51 40 PM

The front-end works great and as expected out of the box (which is awesome I should add!), but I'm so curious why Postman isn't allowing requests and records to be saved. FWIW making POST requests to /api/signin works fine but man, I'm really struggling to understand why the Register API endpoint isn't working as expected in Postman. Cheers!

Auth routes always redirect to login > home when accessed via url

Whenever you access auth routes directly (type /profile/1 into the url bar) I always get redirected first to the login page and then to the home page.

Seems to be related to the async nature of the authenticated variable in auth-route.js.
When I alert(authenticated) it initially returns false which triggers the <Redirect to={{ pathname: '/login' on line 33

Is there any way of awaiting the authenticated check prior to the return statement on line 23 of auth-route.js?
I can't get my head around how to do this.

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.