feat: change email auth config to local

This was done to use the same term. Also email was the old term from HedgeDoc 1 and wildly inaccurate. As we never checked any mail addresses, in fact it was more of a username than anything else.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2021-09-04 19:24:32 +02:00 committed by Yannick Bungers
parent df08d56f28
commit cda8c7ac63
5 changed files with 24 additions and 24 deletions

View file

@ -71,10 +71,10 @@ export class AuthProviders {
oauth2: boolean;
/**
* Is internal auth available?
* Is local auth available?
*/
@IsBoolean()
internal: boolean;
local: boolean;
}
export class BrandingDto {

View file

@ -25,9 +25,9 @@ describe('FrontendConfigService', () => {
const emptyAuthConfig: AuthConfig = {
session: {
secret: 'my-secret',
lifeTime: 1209600000,
lifetime: 1209600000,
},
email: {
local: {
enableLogin: false,
enableRegister: false,
},
@ -197,7 +197,7 @@ describe('FrontendConfigService', () => {
};
const authConfig: AuthConfig = {
...emptyAuthConfig,
email: {
local: {
enableLogin,
enableRegister,
},
@ -262,7 +262,7 @@ describe('FrontendConfigService', () => {
expect(config.authProviders.google).toEqual(
!!authConfig.google.clientID,
);
expect(config.authProviders.internal).toEqual(
expect(config.authProviders.local).toEqual(
enableLogin,
);
expect(config.authProviders.twitter).toEqual(

View file

@ -44,7 +44,7 @@ export class FrontendConfigService {
return {
// ToDo: use actual value here
allowAnonymous: false,
allowRegister: this.authConfig.email.enableRegister,
allowRegister: this.authConfig.local.enableRegister,
authProviders: this.getAuthProviders(),
branding: this.getBranding(),
customAuthNames: this.getCustomAuthNames(),
@ -66,7 +66,7 @@ export class FrontendConfigService {
github: !!this.authConfig.github.clientID,
gitlab: this.authConfig.gitlab.length !== 0,
google: !!this.authConfig.google.clientID,
internal: this.authConfig.email.enableLogin,
local: this.authConfig.local.enableLogin,
ldap: this.authConfig.ldap.length !== 0,
oauth2: this.authConfig.oauth2.length !== 0,
saml: this.authConfig.saml.length !== 0,