File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
SkredvarselGarminWeb/SkredvarselGarminWeb Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ namespace SkredvarselGarminWeb . Options ;
2+
3+ public class ResendOptions
4+ {
5+ public string ApiToken { get ; init ; } = string . Empty ;
6+ }
Original file line number Diff line number Diff line change 7171} ) ;
7272
7373builder . Services . AddHttpClient < ResendClient > ( ) ;
74+
75+ var resendOptionsSection = builder . Configuration . GetSection ( "Resend" ) ;
76+ var resendOptions = resendOptionsSection . Get < ResendOptions > ( ) ;
77+
7478builder . Services . Configure < ResendClientOptions > (
75- o => o . ApiToken = "re_HYBP3fqv_96jb8eUXygqNzNF3DmRNtgyt" ) ;
79+ o => o . ApiToken = resendOptions ! . ApiToken ) ;
7680builder . Services . AddTransient < IResend , ResendClient > ( ) ;
7781builder . Services . AddTransient < IEmailService , EmailService > ( ) ;
7882
Original file line number Diff line number Diff line change 3535 "AdminEmail" : " " ,
3636 "UseWatchAuthorization" : true
3737 },
38+ "Resend" : {
39+ "ApiToken" : " "
40+ },
3841 "Logging" : {
3942 "LogLevel" : {
4043 "Default" : " Information" ,
You can’t perform that action at this time.
0 commit comments