Skip to content

Commit ae088ae

Browse files
committed
Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie
1 parent 26c2328 commit ae088ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+777
-648
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.3
2+
3+
- Fixed OAuth2 cookie bug, where a new session cookie couldn't overwrite an old cookie
4+
15
## 0.2.2
26

37
- Fixed an error that happend when the OAuth session creation request was sent before any other API call

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
[![pub package](https://img.shields.io/pub/v/appwrite.svg)](https://pub.dartlang.org/packages/appwrite)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?v=1)
5-
![Version](https://img.shields.io/badge/api%20version-0.6.1-blue.svg?v=1)
5+
![Version](https://img.shields.io/badge/api%20version-0.6.2-blue.svg?v=1)
66

7-
**This SDK is compatible with Appwrite server version 0.6.1. For older versions, please check previous releases.**
7+
**This SDK is compatible with Appwrite server version 0.6.2. For older versions, please check previous releases.**
88

99
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
1010
Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
@@ -20,7 +20,7 @@ Add this to your package's `pubspec.yaml` file:
2020

2121
```yml
2222
dependencies:
23-
appwrite: ^0.2.2
23+
appwrite: ^0.2.3
2424
```
2525
2626
You can install packages from the command line:
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import 'package:appwrite/appwrite.dart';
22

3-
// Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
66

7-
client
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
89
.setProject('5df5acd0d48c2') // Your project ID
9-
;
10+
;
1011

11-
Future result = account.createOAuth2Session(
12+
Future result = account.createOAuth2Session(
1213
provider: 'bitbucket',
13-
);
14+
);
1415

15-
result
16-
.then((response) {
17-
print(response);
18-
}).catchError((error) {
19-
print(error);
20-
});
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import 'package:appwrite/appwrite.dart';
22

3-
// Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
66

7-
client
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
89
.setProject('5df5acd0d48c2') // Your project ID
9-
;
10+
;
1011

11-
Future result = account.createRecovery(
12+
Future result = account.createRecovery(
1213
email: 'email@example.com',
1314
url: 'https://example.com',
14-
);
15+
);
1516

16-
result
17-
.then((response) {
18-
print(response);
19-
}).catchError((error) {
20-
print(error);
21-
});
17+
result
18+
.then((response) {
19+
print(response);
20+
}).catchError((error) {
21+
print(error.response);
22+
});
23+
}
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import 'package:appwrite/appwrite.dart';
22

3-
// Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
66

7-
client
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
89
.setProject('5df5acd0d48c2') // Your project ID
9-
;
10+
;
1011

11-
Future result = account.createSession(
12+
Future result = account.createSession(
1213
email: 'email@example.com',
1314
password: 'password',
14-
);
15+
);
1516

16-
result
17-
.then((response) {
18-
print(response);
19-
}).catchError((error) {
20-
print(error);
21-
});
17+
result
18+
.then((response) {
19+
print(response);
20+
}).catchError((error) {
21+
print(error.response);
22+
});
23+
}
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import 'package:appwrite/appwrite.dart';
22

3-
// Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
66

7-
client
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
89
.setProject('5df5acd0d48c2') // Your project ID
9-
;
10+
;
1011

11-
Future result = account.createVerification(
12+
Future result = account.createVerification(
1213
url: 'https://example.com',
13-
);
14+
);
1415

15-
result
16-
.then((response) {
17-
print(response);
18-
}).catchError((error) {
19-
print(error);
20-
});
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}

docs/examples/account/create.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
import 'package:appwrite/appwrite.dart';
22

3-
// Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
66

7-
client
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
89
.setProject('5df5acd0d48c2') // Your project ID
9-
;
10+
;
1011

11-
Future result = account.create(
12+
Future result = account.create(
1213
email: 'email@example.com',
1314
password: 'password',
14-
);
15+
);
1516

16-
result
17-
.then((response) {
18-
print(response);
19-
}).catchError((error) {
20-
print(error);
21-
});
17+
result
18+
.then((response) {
19+
print(response);
20+
}).catchError((error) {
21+
print(error.response);
22+
});
23+
}
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
import 'package:appwrite/appwrite.dart';
22

3-
// Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
66

7-
client
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
89
.setProject('5df5acd0d48c2') // Your project ID
9-
;
10+
;
1011

11-
Future result = account.deleteSession(
12+
Future result = account.deleteSession(
1213
sessionId: '[SESSION_ID]',
13-
);
14+
);
1415

15-
result
16-
.then((response) {
17-
print(response);
18-
}).catchError((error) {
19-
print(error);
20-
});
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import 'package:appwrite/appwrite.dart';
22

3-
// Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
66

7-
client
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
89
.setProject('5df5acd0d48c2') // Your project ID
9-
;
10+
;
1011

11-
Future result = account.deleteSessions();
12+
Future result = account.deleteSessions( );
1213

13-
result
14-
.then((response) {
15-
print(response);
16-
}).catchError((error) {
17-
print(error);
18-
});
14+
result
15+
.then((response) {
16+
print(response);
17+
}).catchError((error) {
18+
print(error.response);
19+
});
20+
}

docs/examples/account/delete.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import 'package:appwrite/appwrite.dart';
22

3-
// Init SDK
4-
Client client = Client();
5-
Account account = Account(client);
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
66

7-
client
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
89
.setProject('5df5acd0d48c2') // Your project ID
9-
;
10+
;
1011

11-
Future result = account.delete();
12+
Future result = account.delete( );
1213

13-
result
14-
.then((response) {
15-
print(response);
16-
}).catchError((error) {
17-
print(error);
18-
});
14+
result
15+
.then((response) {
16+
print(response);
17+
}).catchError((error) {
18+
print(error.response);
19+
});
20+
}

0 commit comments

Comments
 (0)