Coder Social home page Coder Social logo

Comments (5)

hosney avatar hosney commented on July 24, 2024 1

The issue is in Conduit.Features.Users.Details.QueryHandler.Handle. The token needs to be added to the user object.

e.g.

var user = _mapper.Map<Domain.Person, User>(person);
user.Token = await _jwtTokenGenerator.CreateToken(person.Username);
return new UserEnvelope(user);

from aspnetcore-realworld-example-app.

adamhathcock avatar adamhathcock commented on July 24, 2024

If the token is lost when refreshing the page, it’s a problem of the front end and not the backend right?

from aspnetcore-realworld-example-app.

hosney avatar hosney commented on July 24, 2024

It seems to work if I switch the api to the conduit url so I suspect the problem might lie on the backend.

from aspnetcore-realworld-example-app.

hosney avatar hosney commented on July 24, 2024

Might have something to do with CORS. When I refresh the page the browser sends an OPTIONS request to /user for which it receives a 204 from the server instead of a 200. The backend and frontend are running on different ports.

from aspnetcore-realworld-example-app.

adamhathcock avatar adamhathcock commented on July 24, 2024

Do you mind submitting a pull request?

from aspnetcore-realworld-example-app.

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.