Private
Public Access
cambios del comms que no le importan a nadie
This commit is contained in:
1 parent
6dddfdb9ab
commit
34ad4424f9
9 files changed
+31
-13
No files matched your search
@@ -11,7 +11,7 @@ object AuthConfig {
|
||||
def load[F[_]: Sync] (envFile: String = ".env"): F[AuthConfig] =
|
||||
Sync[F].delay {
|
||||
val env = EnvFile.load(envFile)
|
||||
val required = ConfigUtils.required(env, envFile) _
|
||||
val required = ConfigUtils.required(env, envFile)
|
||||
|
||||
AuthConfig(
|
||||
secret = required("JWT_SECRET"),
|
||||
|
||||
@@ -16,7 +16,7 @@ object SmtpConfig {
|
||||
def load[F[_]: Sync](envFile: String = ".env"): F[SmtpConfig] =
|
||||
Sync[F].delay {
|
||||
val env = EnvFile.load(envFile)
|
||||
val required = ConfigUtils.required(env, envFile) _
|
||||
val required = ConfigUtils.required(env, envFile)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.fede.comms.webhook
|
||||
|
||||
|
||||
enum FlagsWebhook:
|
||||
case Discord
|
||||
case Raw
|
||||
@@ -17,9 +17,9 @@ class HttpWebHook[F[_]: Concurrent](client: Client[F]) extends WebHook[F] {
|
||||
method = POST,
|
||||
uri = Uri.unsafeFromString(target)
|
||||
).withEntity(m.toStringDiscord)
|
||||
.putHeaders(`Content-Type`(MediaType.application.json))
|
||||
.putHeaders(`Content-Type`(MediaType.application.json))
|
||||
|
||||
client.run(request).use { response =>
|
||||
client.run(request).use { response =>
|
||||
if (response.status.isSuccess)
|
||||
Concurrent[F].unit
|
||||
else
|
||||
@@ -29,7 +29,7 @@ class HttpWebHook[F[_]: Concurrent](client: Client[F]) extends WebHook[F] {
|
||||
s"Webhook POST to $target failed with status ${response.status.code}: $body"
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.fede.comms.webhook
|
||||
import io.circe.{Decoder, Encoder}
|
||||
import io.circe.generic.semiauto._
|
||||
import org.http4s.circe.{jsonOf}
|
||||
import io.circe.generic.auto._
|
||||
import io.circe.syntax._
|
||||
// import org.http3s.circe.{jsonEncoderOf}
|
||||
import org.http4s.{EntityDecoder}
|
||||
|
||||
Reference in new issue
Block a user