File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
templates/flutter/lib/src Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -187,11 +187,16 @@ class ClientIO extends ClientBase with ClientMixin {
187187
188188 Future webAuth(Uri url) {
189189 return FlutterWebAuth.authenticate(
190- url: url.toString(),
191- callbackUrlScheme: "appwrite-callback-" + config['project']!)
192- .then((value) async {
193- Cookie cookie = new Cookie(
194- url.queryParameters['key']!, url.queryParameters['secret']!);
190+ url: url.toString(),
191+ callbackUrlScheme: "appwrite-callback-" + config['project']!,
192+ ).then((value) async {
193+ final key = url.queryParameters['key'];
194+ final secret = url.queryParameters['secret'];
195+ if (key == null || secret == null) {
196+ throw {{spec .title | caseUcfirst }}Exception(
197+ "Invalid OAuth2 Response. Key and Secret not available.", 500);
198+ }
199+ Cookie cookie = new Cookie(key, secret);
195200 cookie.domain = Uri.parse(_endPoint).host;
196201 cookie.httpOnly = true;
197202 cookie.path = '/';
You can’t perform that action at this time.
0 commit comments