Comments (2)
@cleanstartgit thanks for using brick.
You should retrieve the token and then store it on the default headers that will be accessed when making subsequent requests:
import 'package:http/http.dart' as http;
try {
final authResponse = http.post('/token', headers: myEncryptedCredentials);
final token = jsonDecode(authReponse.body)['token'];
MyRepository().remoteProvider.defaultHeaders = { 'Authorization' => 'Token $token', 'Content-Type': 'application/json' }
} catch (e) {
}
from brick.
@tshedor Thank you for the quick response!
I saw the defaultHeaders field in the docs late last night, but I couldn't figure out how to access/set them. Thank you for the insight.
This is such an amazing app, kudos to you and the team. I will gladly buy you guys pizzas and beer next time I'm out that way!
from brick.
Related Issues (20)
- Need to run build_runner twice for correct schema.g.dart generation HOT 1
- Discussion: cache busting HOT 4
- **Migrating to Brick 3 from Brick 2**
- Casting issue with latest example code. HOT 2
- Migration not created for Sqlite Database when extending Model after upgrade to 3.0 HOT 4
- brick.g.dart is not generated HOT 7
- Example doesn't work and doesn't show server errors HOT 14
- how to prevent an attribute from being generated for the ToRest adapter HOT 1
- Build_runner runs with problems HOT 7
- How to send the child relation to the server? HOT 8
- Error when generating migration HOT 4
- Supabase HOT 15
- Converting object to an encodable object failed when adding a second item to an association HOT 7
- Add http ^1.0.0 support HOT 2
- Is this the same as realm db or couch db lite? HOT 4
- How to use with Firestore. HOT 1
- Subscribe is not listening to remote changes even when policy is set to OfflineFirstGetPolicy.awaitRemote HOT 6
- Feature: Synchronized app indicator HOT 1
- Deleting a document that has already been deleted from the server causes an error HOT 3
- Is this package still being maintain? 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 brick.