File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "rules" : {
33 "users" : {
44 "$user" : {
5- ".write" : " auth !== null && (auth.token.email_verified === true || auth.provider === 'facebook') && ( (auth.token.isAdmin === true && data.child('isAdmin').val() === false) || auth.uid === $user)" ,
6- ".read" : " auth !== null && (auth.token.email_verified === true || auth.provider === 'facebook') && ( (auth.token.isAdmin === true && data.child('isAdmin').val() === false) || auth.uid === $user)"
5+ ".write" : " auth !== null && ((auth.token.isAdmin === true && data.child('isAdmin').val() === false) || auth.uid === $user)" ,
6+ ".read" : " auth !== null && ((auth.token.isAdmin === true && data.child('isAdmin').val() === false) || auth.uid === $user)"
77 },
8- ".write" : " auth !== null && (auth.token.email_verified === true || auth.provider === 'facebook') && auth.token.isAdmin === true" ,
9- ".read" : " auth !== null && (auth.token.email_verified === true || auth.provider === 'facebook') && auth.token.isAdmin === true"
8+ ".write" : " auth !== null && auth.token.isAdmin === true" ,
9+ ".read" : " auth !== null && auth.token.isAdmin === true"
1010 }
1111 }
1212}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ beforeEach(() => {
4747 jest . spyOn ( reactRedux , 'useDispatch' ) . mockImplementation ( ( ) => dispatchMock ) ;
4848 jest . spyOn ( authActions , 'authFacebook' ) . mockImplementation ( jest . fn ) ;
4949 jest . spyOn ( authActions , 'authGoogle' ) . mockImplementation ( jest . fn ) ;
50+ jest . spyOn ( authActions , 'authMicrosoft' ) . mockImplementation ( jest . fn ) ;
5051} ) ;
5152
5253it ( 'should dispatch authFacebook action when the user tries to log in with Facebook' , ( ) => {
@@ -72,3 +73,15 @@ it('should dispatch authGoogle action when the user tries to log in with Google'
7273
7374 expect ( authActions . authGoogle ) . toHaveBeenCalled ( ) ;
7475} ) ;
76+
77+ it ( 'should dispatch authMicrosoft action when the user tries to log in with Microsoft' , ( ) => {
78+ const { component } = mountWithProviders ( < Login /> ) ( {
79+ auth : {
80+ userData : { }
81+ }
82+ } ) ;
83+
84+ component . find ( '#microsoft' ) . simulate ( 'click' ) ;
85+
86+ expect ( authActions . authMicrosoft ) . toHaveBeenCalled ( ) ;
87+ } ) ;
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ import {
1212 setPassword ,
1313 authCleanUp ,
1414 authFacebook ,
15- authGoogle
15+ authGoogle ,
16+ authMicrosoft
1617} from 'state/actions/auth' ;
1718import { useChangeHandler , useFormatMessage } from 'hooks' ;
1819import { inputValidations } from 'utils' ;
@@ -80,7 +81,7 @@ const Login = () => {
8081 } ;
8182
8283 const onMicrosoftHandler = ( ) => {
83- alert ( 'Coming soon' ) ;
84+ dispatch ( authMicrosoft ( ) ) ;
8485 } ;
8586
8687 const inputs = isEmailLink
Original file line number Diff line number Diff line change @@ -314,3 +314,8 @@ export const authGoogle = () => {
314314 provider . addScope ( 'https://www.googleapis.com/auth/userinfo.email' ) ;
315315 return authWithProvider ( provider ) ;
316316} ;
317+
318+ export const authMicrosoft = ( ) => {
319+ const provider = new firebase . auth . OAuthProvider ( 'microsoft.com' ) ;
320+ return authWithProvider ( provider ) ;
321+ } ;
You can’t perform that action at this time.
0 commit comments