File tree Expand file tree Collapse file tree 3 files changed +42
-1
lines changed
apps/demo/src/plugin-demos
tools/assets/App_Resources/iOS Expand file tree Collapse file tree 3 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,45 @@ export class DemoModel extends DemoSharedFirebaseAuth {
28
28
} ) ;
29
29
}
30
30
31
+ async linkGithub ( ) {
32
+ if ( ! this . user ) {
33
+ return ;
34
+ }
35
+ const provider = new OAuthProvider ( 'github.com' ) ;
36
+ provider . addCustomParameter ( 'allow_signup' , 'false' ) ;
37
+ provider . setScopes ( [ 'user:email' ] ) ;
38
+
39
+ firebase ( )
40
+ . auth ( )
41
+ . getProviderCredential ( provider )
42
+ . then ( ( cred ) => {
43
+ firebase ( ) . auth ( ) . currentUser . linkWithCredential ( cred ) ;
44
+ console . log ( 'cred' , cred ) ;
45
+ } )
46
+ . catch ( ( e ) => {
47
+ console . log ( 'Failed to link Github' , e ) ;
48
+ } ) ;
49
+ }
50
+
51
+ async linkYahoo ( ) {
52
+ if ( ! this . user ) {
53
+ return ;
54
+ }
55
+ const provider = new OAuthProvider ( 'yahoo.com' ) ;
56
+ provider . addCustomParameter ( 'prompt' , 'login' ) ;
57
+ provider . addCustomParameter ( 'language' , 'en' ) ;
58
+
59
+ firebase ( )
60
+ . auth ( )
61
+ . getProviderCredential ( provider )
62
+ . then ( ( cred ) => {
63
+ firebase ( ) . auth ( ) . currentUser . linkWithCredential ( cred ) ;
64
+ } )
65
+ . catch ( ( e ) => {
66
+ console . log ( 'Failed to link Yahoo' , e ) ;
67
+ } ) ;
68
+ }
69
+
31
70
async linkGoogle ( ) {
32
71
try {
33
72
if ( ! this . user ) {
Original file line number Diff line number Diff line change 16
16
<Button text =" Login User With Phone" tap =" {{ loginWithPhone }}" class =" btn btn-primary" />
17
17
<Button text =" Link User Phone" tap =" {{ linkPhone }}" class =" btn btn-primary" />
18
18
<Button text =" Link Google" tap =" {{ linkGoogle }}" class =" btn btn-primary" />
19
+ <Button text =" Link user with Github" tap =" {{ linkGithub }}" class =" btn btn-primary" />
20
+ <Button text =" Login user with Yahoo" tap =" {{ linkYahoo }}" class =" btn btn-primary" />
19
21
<Button text =" Get Current User" tap =" {{ getCurrentUser }}" class =" btn btn-primary" />
20
22
<Button text =" Logout User" tap =" {{ logOutUser }}" class =" btn btn-primary" />
21
23
<StackLayout >
Original file line number Diff line number Diff line change 7
7
<key >REVERSED_CLIENT_ID </key >
8
8
<string >com.googleusercontent.apps.292142294722-23nmrq9mn8rhpqipjc1bt4qecga3qgsf </string >
9
9
<key >ANDROID_CLIENT_ID </key >
10
- <string >292142294722-ckf8oa3neiemb5ju5naesnkqqidbn92o .apps.googleusercontent.com </string >
10
+ <string >292142294722-9s58kof5a3ng34vqhj51gs04qlr6jjgf .apps.googleusercontent.com </string >
11
11
<key >API_KEY </key >
12
12
<string >AIzaSyCYCaQR0vcgewpD1XhzsuSI9PHQugCtan4 </string >
13
13
<key >GCM_SENDER_ID </key >
You can’t perform that action at this time.
0 commit comments