This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Latest firebase update * Updates in auth * Support for storage buckets * AuthCredential provider deprecated * Deprecated message
- Loading branch information
Showing
17 changed files
with
141 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: firebase | ||
description: Dart libraries for Firebase | ||
version: 3.0.2 | ||
version: 3.1.0 | ||
authors: | ||
- Jana Moudra <[email protected]> | ||
- Kevin Moore <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ void main() { | |
}); | ||
test('credential', () { | ||
var cred = EmailAuthProvider.credential('un', 'pw'); | ||
expect(cred.provider, equals(EmailAuthProvider.PROVIDER_ID)); | ||
expect(cred.providerId, equals(EmailAuthProvider.PROVIDER_ID)); | ||
}); | ||
}); | ||
|
||
|
@@ -51,7 +51,7 @@ void main() { | |
}); | ||
test('credential', () { | ||
var cred = FacebookAuthProvider.credential('token'); | ||
expect(cred.provider, equals(FacebookAuthProvider.PROVIDER_ID)); | ||
expect(cred.providerId, equals(FacebookAuthProvider.PROVIDER_ID)); | ||
}); | ||
test('scope', () { | ||
var provider = new FacebookAuthProvider(); | ||
|
@@ -76,7 +76,7 @@ void main() { | |
}); | ||
test('credential', () { | ||
var cred = GithubAuthProvider.credential('token'); | ||
expect(cred.provider, equals(GithubAuthProvider.PROVIDER_ID)); | ||
expect(cred.providerId, equals(GithubAuthProvider.PROVIDER_ID)); | ||
}); | ||
test('scope', () { | ||
var provider = new GithubAuthProvider(); | ||
|
@@ -101,7 +101,7 @@ void main() { | |
}); | ||
test('credential', () { | ||
var cred = GoogleAuthProvider.credential('idToken', 'accessToken'); | ||
expect(cred.provider, equals(GoogleAuthProvider.PROVIDER_ID)); | ||
expect(cred.providerId, equals(GoogleAuthProvider.PROVIDER_ID)); | ||
}); | ||
test('scope', () { | ||
var provider = new GoogleAuthProvider(); | ||
|
@@ -127,7 +127,7 @@ void main() { | |
}); | ||
test('credential', () { | ||
var cred = TwitterAuthProvider.credential('token', 'secret'); | ||
expect(cred.provider, equals(TwitterAuthProvider.PROVIDER_ID)); | ||
expect(cred.providerId, equals(TwitterAuthProvider.PROVIDER_ID)); | ||
}); | ||
test('custom parameters', () { | ||
var provider = new TwitterAuthProvider(); | ||
|
@@ -210,6 +210,48 @@ void main() { | |
rethrow; | ||
} | ||
}); | ||
|
||
test('link anonymous user with credential', () async { | ||
try { | ||
user = await authValue.signInAnonymously(); | ||
expect(user.isAnonymous, isTrue); | ||
|
||
var credential = | ||
EmailAuthProvider.credential("[email protected]", "janicka"); | ||
user = await user.linkWithCredential(credential); | ||
expect(user.isAnonymous, isFalse); | ||
expect(user.email, "[email protected]"); | ||
} on FirebaseError catch (e) { | ||
printException(e); | ||
rethrow; | ||
} | ||
}); | ||
|
||
test('reauthenticate with credential', () async { | ||
try { | ||
user = await authValue.createUserWithEmailAndPassword( | ||
"[email protected]", "janicka"); | ||
|
||
var credential = | ||
EmailAuthProvider.credential("[email protected]", "janicka"); | ||
await user.reauthenticateWithCredential(credential); | ||
|
||
expect(authValue.currentUser, isNotNull); | ||
expect(authValue.currentUser.email, "[email protected]"); | ||
} on FirebaseError catch (e) { | ||
printException(e); | ||
rethrow; | ||
} | ||
}); | ||
|
||
test('reauthenticate with bad credential fails', () async { | ||
user = await authValue.createUserWithEmailAndPassword( | ||
"[email protected]", "janicka"); | ||
var credential = | ||
EmailAuthProvider.credential("[email protected]", "something"); | ||
|
||
expect(user.reauthenticateWithCredential(credential), throws); | ||
}); | ||
}); | ||
|
||
group('registered user', () { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters