Skip to content

Commit

Permalink
feat: csrf忽略:/api/v1/users/refreshToken;外置SentyDsn;关闭aliOss;
Browse files Browse the repository at this point in the history
csrf忽略:/api/v1/users/refreshToken;外置SentyDsn;关闭aliOss;
  • Loading branch information
Imfdj committed Jul 28, 2021
1 parent ba5f73b commit 9eb3890
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AppBootHook {
// this.app.cacheData = await this.app.model.query(QUERY_CACHE_SQL);

Sentry.init({
dsn: 'http://[email protected]/4',
dsn: this.app.config.sentry.dsn || '',
});
// logger记录error并在prod环境下发送错误到Sentry
this.app.logger.errorAndSentry = (msg, ...arg) => {
Expand Down
2 changes: 1 addition & 1 deletion config/config.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.security = {
enable: false,
// 判断是否需要 ignore 的方法,请求上下文 context 作为第一个参数
ignore: ctx => {
return ['/api/v1/users/login', '/api/v1/users/login', '/api/v1/users/github/login', '/api/v1/verification_codes'].includes(ctx.request.url);
return ['/api/v1/users/login', '/api/v1/users/refreshToken', '/api/v1/users/github/login', '/api/v1/verification_codes'].includes(ctx.request.url);
},
},
// domainWhiteList: ['http://localhost:8000'],
Expand Down
4 changes: 4 additions & 0 deletions config/config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ exports.io = {
return `${req._query.userId}_${uuidv4()}`;
},
};

exports.sentry = {
dsn: process.env.SentyDsn || '',
};

0 comments on commit 9eb3890

Please sign in to comment.