mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 03:27:05 -04:00
Add one-click login if possible (#1043)
This commit is contained in:
parent
a6c80ac1f0
commit
6d2dde477c
26 changed files with 216 additions and 53 deletions
|
@ -4,6 +4,12 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare namespace Cypress {
|
||||
interface Chainable {
|
||||
loadConfig(): Chainable<Window>
|
||||
}
|
||||
}
|
||||
|
||||
export const banner = {
|
||||
text: 'This is the mock banner call',
|
||||
timestamp: '2020-05-22T20:46:08.962Z'
|
||||
|
@ -14,47 +20,54 @@ export const branding = {
|
|||
logo: '/img/acme.png'
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
cy.intercept('/api/v2/config', {
|
||||
export const authProviders = {
|
||||
facebook: true,
|
||||
github: true,
|
||||
twitter: true,
|
||||
gitlab: true,
|
||||
dropbox: true,
|
||||
ldap: true,
|
||||
google: true,
|
||||
saml: true,
|
||||
oauth2: true,
|
||||
internal: true,
|
||||
openid: true
|
||||
}
|
||||
|
||||
export const config = {
|
||||
allowAnonymous: true,
|
||||
authProviders: authProviders,
|
||||
branding: branding,
|
||||
banner: banner,
|
||||
customAuthNames: {
|
||||
ldap: 'FooBar',
|
||||
oauth2: 'Olaf2',
|
||||
saml: 'aufSAMLn.de'
|
||||
},
|
||||
maxDocumentLength: 200,
|
||||
specialLinks: {
|
||||
privacy: 'https://example.com/privacy',
|
||||
termsOfUse: 'https://example.com/termsOfUse',
|
||||
imprint: 'https://example.com/imprint'
|
||||
},
|
||||
plantumlServer: 'http://mock-plantuml.local',
|
||||
version: {
|
||||
version: 'mock',
|
||||
sourceCodeUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
||||
issueTrackerUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
|
||||
},
|
||||
'iframeCommunication': {
|
||||
'editorOrigin': 'http://127.0.0.1:3001',
|
||||
'rendererOrigin': 'http://127.0.0.1:3001'
|
||||
}
|
||||
}
|
||||
|
||||
Cypress.Commands.add('loadConfig', (additionalConfig?: Partial<typeof config>) => {
|
||||
return cy.intercept('/api/v2/config', {
|
||||
statusCode: 200,
|
||||
body: {
|
||||
allowAnonymous: true,
|
||||
authProviders: {
|
||||
facebook: true,
|
||||
github: true,
|
||||
twitter: true,
|
||||
gitlab: true,
|
||||
dropbox: true,
|
||||
ldap: true,
|
||||
google: true,
|
||||
saml: true,
|
||||
oauth2: true,
|
||||
email: true,
|
||||
openid: true
|
||||
},
|
||||
branding: branding,
|
||||
banner: banner,
|
||||
customAuthNames: {
|
||||
ldap: 'FooBar',
|
||||
oauth2: 'Olaf2',
|
||||
saml: 'aufSAMLn.de'
|
||||
},
|
||||
maxDocumentLength: 200,
|
||||
specialLinks: {
|
||||
privacy: 'https://example.com/privacy',
|
||||
termsOfUse: 'https://example.com/termsOfUse',
|
||||
imprint: 'https://example.com/imprint'
|
||||
},
|
||||
plantumlServer: 'http://mock-plantuml.local',
|
||||
version: {
|
||||
version: 'mock',
|
||||
sourceCodeUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
||||
issueTrackerUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'
|
||||
},
|
||||
'iframeCommunication': {
|
||||
'editorOrigin': 'http://127.0.0.1:3001',
|
||||
'rendererOrigin': 'http://127.0.0.1:3001'
|
||||
}
|
||||
...config,
|
||||
...additionalConfig
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue