75 lines
1.5 KiB
JavaScript
75 lines
1.5 KiB
JavaScript
// @flow
|
|
|
|
export function slackAuth(
|
|
state: string,
|
|
scopes: string[] = [
|
|
'identity.email',
|
|
'identity.basic',
|
|
'identity.avatar',
|
|
'identity.team',
|
|
],
|
|
redirectUri: string = `${process.env.URL}/auth/slack.callback`
|
|
): string {
|
|
const baseUrl = 'https://slack.com/oauth/authorize';
|
|
const params = {
|
|
client_id: process.env.SLACK_KEY,
|
|
scope: scopes ? scopes.join(' ') : '',
|
|
redirect_uri: redirectUri,
|
|
state,
|
|
};
|
|
|
|
const urlParams = Object.keys(params)
|
|
.map(key => `${key}=${encodeURIComponent(params[key])}`)
|
|
.join('&');
|
|
|
|
return `${baseUrl}?${urlParams}`;
|
|
}
|
|
|
|
export function githubUrl(): string {
|
|
return 'https://www.github.com/outline';
|
|
}
|
|
|
|
export function githubIssuesUrl(): string {
|
|
return 'https://www.github.com/outline/outline/issues';
|
|
}
|
|
|
|
export function slackAppStoreUrl(): string {
|
|
return 'https://goabstract.slack.com/apps/A0W3UMKBQ-outline';
|
|
}
|
|
|
|
export function blogUrl(): string {
|
|
return 'https://medium.com/getoutline';
|
|
}
|
|
|
|
export function twitterUrl(): string {
|
|
return 'https://twitter.com/outlinewiki';
|
|
}
|
|
|
|
export function spectrumUrl(): string {
|
|
return 'https://spectrum.chat/outline';
|
|
}
|
|
|
|
export function mailToUrl(): string {
|
|
return 'mailto:hello@getoutline.com';
|
|
}
|
|
|
|
export function developers(): string {
|
|
return '/developers';
|
|
}
|
|
|
|
export function changelog(): string {
|
|
return '/changelog';
|
|
}
|
|
|
|
export function signin(service: string = 'slack'): string {
|
|
return `/auth/${service}`;
|
|
}
|
|
|
|
export function about(): string {
|
|
return '/about';
|
|
}
|
|
|
|
export function privacy(): string {
|
|
return '/privacy';
|
|
}
|