Skip to content

Commit 54cf11a

Browse files
committed
Added Secrets.MD to CodeCapture/CodeCapture/Models
1 parent 7a944c9 commit 54cf11a

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

CodeCapture/CodeCapture/EmailResult.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ private async void emailButton_Clicked(object sender, EventArgs e)
3434
Models.Secrets secrets = new Models.Secrets();
3535
MailMessage mail = new MailMessage();
3636
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
37-
mail.From = new MailAddress("[email protected]");
37+
mail.From = new MailAddress(secrets.EMAIl_address);
3838
mail.To.Add(emailID.Text);
3939
mail.Subject = "CodeCapture Scan";
4040
mail.Body = body.Text;
4141
SmtpServer.Port = 587;
4242
SmtpServer.Host = "smtp.gmail.com";
4343
SmtpServer.EnableSsl = true;
4444
SmtpServer.UseDefaultCredentials = false;
45-
SmtpServer.Credentials = new System.Net.NetworkCredential("[email protected]", secrets.EMAIL_password);
45+
SmtpServer.Credentials = new System.Net.NetworkCredential(secrets.EMAIl_address, secrets.EMAIL_password);
4646
SmtpServer.Send(mail);
4747
await DisplayAlert("Email Sent Succesfully!!!", "Please check your email", "OK");
4848
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
You may have noticed that there are references to a file **Secrets** in **namespace CodeCapture.Models** at various instances. That file has not been added to the repository as it contains the following sensitive information:
2+
3+
* GMail Address
4+
* GMail Password
5+
* Azure Computer Vision Read API Subscription Key
6+
* Azure Computer Vision Read API Endpoint
7+
* JDoodle Compiler API Client ID
8+
* JDoodle Compiler API Client Secret
9+
10+
You can create your own version of the **Secrets.cs** in this [folder](https://github.com/adityaoberai/CodeCapture/tree/master/CodeCapture/CodeCapture/Models) in the following format:
11+
12+
```
13+
14+
using System;
15+
using System.Collections.Generic;
16+
using System.Text;
17+
18+
namespace CodeCapture.Models
19+
{
20+
class Secrets
21+
{
22+
public string EMAIL_address { get; set; } = <GMail Address>
23+
public string EMAIL_password { get; set; } = <GMail Password>;
24+
public string READ_subscriptionKey { get; set; } = <Azure Computer Vision Read API Subscription Key>;
25+
public string READ_endpoint { get; set; } = <Azure Computer Vision Read API Endpoint>;
26+
public string JDOODLE_clientId { get; set; } = <JDoodle Compiler API Client ID>;
27+
public string JDOODLE_clientSecret { get; set; } = <JDoodle Compiler API Client Secret>;
28+
}
29+
}
30+
31+
```

0 commit comments

Comments
 (0)