Mark google activated by default for old configs
This commit is contained in:
parent
f3f60aee78
commit
249df46770
|
@ -31,7 +31,13 @@ describe("run misc tests", () => {
|
||||||
describe("/version", () => {
|
describe("/version", () => {
|
||||||
it("should confirm version", async () => {
|
it("should confirm version", async () => {
|
||||||
const res = await request.get("/version").expect(200)
|
const res = await request.get("/version").expect(200)
|
||||||
expect(res.text.split(".").length).toEqual(3)
|
const text = res.text
|
||||||
|
if (text.includes("alpha")) {
|
||||||
|
expect(text.split(".").length).toEqual(4)
|
||||||
|
} else {
|
||||||
|
expect(text.split(".").length).toEqual(3)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -149,16 +149,16 @@ exports.publicSettings = async function (ctx) {
|
||||||
config = publicConfig
|
config = publicConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
config.config.google = !googleConfig
|
// google button flag
|
||||||
? !!googleConfig
|
const googleActivated =
|
||||||
: !googleConfig.config.activated
|
googleConfig.config.activated == undefined || // activated by default for configs pre-activated flag
|
||||||
? false
|
googleConfig.config.activated
|
||||||
: true
|
config.config.google = !googleConfig ? false : googleActivated
|
||||||
config.config.oidc = !oidcConfig
|
|
||||||
? !!oidcConfig
|
// oidc button flag
|
||||||
: !oidcConfig.config.configs[0].activated
|
const oidcActivated = !oidcConfig.config.configs[0].activated
|
||||||
? false
|
config.config.oidc = !oidcConfig ? false : oidcActivated
|
||||||
: true
|
|
||||||
ctx.body = config
|
ctx.body = config
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
ctx.throw(err.status, err)
|
ctx.throw(err.status, err)
|
||||||
|
|
Loading…
Reference in New Issue