Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axum API: user context #196

Merged
merged 7 commits into from
Jun 14, 2023
Merged

Axum API: user context #196

merged 7 commits into from
Jun 14, 2023

Conversation

josecelano
Copy link
Member

API migration to Axum for user context.

@josecelano josecelano added the Code Cleanup / Refactoring Tidying and Making Neat label Jun 13, 2023
@josecelano josecelano linked an issue Jun 13, 2023 that may be closed by this pull request
With the new Axum implementation for the API the browser does not make
request to the API becuase of the Cross-Origin Resource Sharing (CORS)
policy. By default there is no header `Access-Control-Allow-Origin` and
it does not allow the request.

You can be permissive by adding a layer to the router:

```
Router::new().nest("/v1", api_routes).layer(CorsLayer::permissive())
```

For the time being you need to change that line manually when you want
to setup a dev env with the banckend and the frontend using different
ports.
@josecelano josecelano marked this pull request as ready for review June 14, 2023 15:52
@josecelano josecelano merged commit 03dba5c into torrust:develop Jun 14, 2023
@da2ce7
Copy link
Contributor

da2ce7 commented Jun 16, 2023

Looks Good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup / Refactoring Tidying and Making Neat
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Axum API: user context
2 participants