feat: register server-side validation + forgot password UI

This commit is contained in:
Nicolas Giard
2018-12-20 23:02:17 -05:00
parent 901dbb98e0
commit 78ae137f48
6 changed files with 140 additions and 29 deletions

View File

@@ -30,6 +30,10 @@ module.exports = class Authentication extends Model {
}
}
static async getStrategy(key) {
return WIKI.models.authentication.query().findOne({ key })
}
static async getStrategies(isEnabled) {
const strategies = await WIKI.models.authentication.query().where(_.isBoolean(isEnabled) ? { isEnabled } : {})
return _.sortBy(strategies.map(str => ({