Changeset 0.29.0 (#195)
This commit is contained in:
@@ -70,12 +70,7 @@ func AuthOrSession(cfg *config.Config, stores store.Stores, cache *UserStatusCac
|
||||
}
|
||||
|
||||
// Verify channel exists, is workflow type, and allows anonymous
|
||||
var chType string
|
||||
var allowAnon bool
|
||||
err := database.DB.QueryRowContext(c.Request.Context(),
|
||||
database.Q(`SELECT type, allow_anonymous FROM channels WHERE id = $1`),
|
||||
channelID,
|
||||
).Scan(&chType, &allowAnon)
|
||||
chType, allowAnon, err := stores.Channels.GetTypeAndAllowAnonymous(c.Request.Context(), channelID)
|
||||
if err != nil {
|
||||
c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"error": "authentication required"})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user