File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
2+ "firestore" : {
3+ "rules" : " firestore.rules"
4+ },
25 "hosting" : {
36 "public" : " www/browser" ,
47 "ignore" : [
Original file line number Diff line number Diff line change 1+ rules_version = ' 2' ;
2+ service cloud .firestore {
3+ match / databases/ {database }/ documents {
4+ match / users/ {userId } {
5+ allow read , write : if request .auth != null && request .auth.token.email == userId;
6+ }
7+ }
8+ }
Original file line number Diff line number Diff line change @@ -37,15 +37,17 @@ export class AuthService {
3737 try {
3838 await this . afAuth . createUserWithEmailAndPassword ( email , password ) ;
3939 } catch ( e ) {
40- alert ( 'Error!' + e . message ) ;
40+ console . error ( 'Signup error:' , e ) ;
41+ alert ( 'Sign up failed. Please check your details and try again.' ) ;
4142 }
4243 }
4344
4445 async emailLogin ( email : string , password : string ) {
4546 try {
4647 await this . afAuth . signInWithEmailAndPassword ( email , password ) ;
4748 } catch ( e ) {
48- alert ( 'Error!' + e . message ) ;
49+ console . error ( 'Login error:' , e ) ;
50+ alert ( 'Login failed. Please check your email and password.' ) ;
4951 }
5052 }
5153
Original file line number Diff line number Diff line change @@ -124,9 +124,15 @@ export class TodayPage implements OnInit {
124124 const startIndex = text . toLowerCase ( ) . indexOf ( query . toLowerCase ( ) ) ;
125125 if ( startIndex !== - 1 ) {
126126 const matchingString = text . substring ( startIndex , query . length ) ;
127+ const escaped = matchingString
128+ . replace ( / & / g, '&' )
129+ . replace ( / < / g, '<' )
130+ . replace ( / > / g, '>' )
131+ . replace ( / " / g, '"' )
132+ . replace ( / ' / g, ''' ) ;
127133 text = text . replace (
128134 matchingString ,
129- `<span (click)="unmark($event)" class="highlight">${ matchingString } </span>` ,
135+ `<span class="highlight">${ escaped } </span>` ,
130136 ) ;
131137 }
132138 } ) ;
You can’t perform that action at this time.
0 commit comments