internal sealed class Configuration DbMigrationsConfigur ation micro_b

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
internal sealed class Configuration : DbMigrationsConfiguration<micro_blog.api.AuthContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = false;
ContextKey = "micro_blog.api.AuthContext";
}
protected override void Seed(AuthContext context)
{
if (context.Clients.Any()) return;
context.Clients.Add(new Client
{
Id = "AngularTestApp",
Secret = Helper.GetHash("abc@123"),
Name = "angular js front-end application",
ApplicationType = ApplicationTypes.JavaScript,
Active = true,
RefreshTokenLifeTime = 14400,//time in minutes equals 10 days
AllowedOrigin = "http://localhost:29554"//from angular web app
});
context.SaveChanges();
}
}