Convert rocketchat-oauth2-server-config to main module structure (#12773)
parent
fc297877d8
commit
df054a459e
@ -1,3 +0,0 @@ |
||||
import { Mongo } from 'meteor/mongo'; |
||||
|
||||
this.ChatOAuthApps = new Mongo.Collection('rocketchat_oauth_apps'); |
@ -0,0 +1,3 @@ |
||||
import { Mongo } from 'meteor/mongo'; |
||||
|
||||
export const ChatOAuthApps = new Mongo.Collection('rocketchat_oauth_apps'); |
@ -1,5 +1,6 @@ |
||||
import { FlowRouter } from 'meteor/kadira:flow-router' ; |
||||
import { BlazeLayout } from 'meteor/kadira:blaze-layout'; |
||||
import { t } from 'meteor/rocketchat:ui'; |
||||
|
||||
FlowRouter.route('/admin/oauth-apps', { |
||||
name: 'admin-oauth-apps', |
@ -1,3 +1,5 @@ |
||||
import { RocketChat } from 'meteor/rocketchat:lib'; |
||||
|
||||
RocketChat.AdminBox.addOption({ |
||||
href: 'admin-oauth-apps', |
||||
i18nLabel: 'OAuth Apps', |
@ -1,10 +1,11 @@ |
||||
/* globals ChatOAuthApps */ |
||||
|
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { ReactiveVar } from 'meteor/reactive-var'; |
||||
import { FlowRouter } from 'meteor/kadira:flow-router'; |
||||
import { Template } from 'meteor/templating'; |
||||
import { TAPi18n } from 'meteor/tap:i18n'; |
||||
import { RocketChat, handleError } from 'meteor/rocketchat:lib'; |
||||
import { t, modal } from 'meteor/rocketchat:ui'; |
||||
import { ChatOAuthApps } from '../collection'; |
||||
import toastr from 'toastr'; |
||||
|
||||
Template.oauthApp.onCreated(function() { |
@ -1,5 +1,6 @@ |
||||
/* globals ChatOAuthApps */ |
||||
import { Template } from 'meteor/templating'; |
||||
import { RocketChat } from 'meteor/rocketchat:lib'; |
||||
import { ChatOAuthApps } from '../collection'; |
||||
import moment from 'moment'; |
||||
|
||||
Template.oauthApps.onCreated(function() { |
@ -0,0 +1,9 @@ |
||||
import './oauth/stylesheets/oauth2.css'; |
||||
import './oauth/oauth2-client.html'; |
||||
import './oauth/oauth2-client'; |
||||
import './admin/startup'; |
||||
import './admin/route'; |
||||
import './admin/views/oauthApp.html'; |
||||
import './admin/views/oauthApp'; |
||||
import './admin/views/oauthApps.html'; |
||||
import './admin/views/oauthApps'; |
@ -1,9 +1,8 @@ |
||||
// @ChatOAuthApps = new Mongo.Collection 'rocketchat_oauth_apps'
|
||||
/* globals ChatOAuthApps */ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { FlowRouter } from 'meteor/kadira:flow-router' ; |
||||
import { BlazeLayout } from 'meteor/kadira:blaze-layout'; |
||||
import { Template } from 'meteor/templating'; |
||||
import { ChatOAuthApps } from '../admin/collection'; |
||||
|
||||
FlowRouter.route('/oauth/authorize', { |
||||
action(params, queryParams) { |
@ -1,5 +1,6 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { Random } from 'meteor/random'; |
||||
import { RocketChat } from 'meteor/rocketchat:lib'; |
||||
import _ from 'underscore'; |
||||
|
||||
Meteor.methods({ |
@ -1,4 +1,5 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { RocketChat } from 'meteor/rocketchat:lib'; |
||||
|
||||
Meteor.methods({ |
||||
deleteOAuthApp(applicationId) { |
@ -1,4 +1,5 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { RocketChat } from 'meteor/rocketchat:lib'; |
||||
import _ from 'underscore'; |
||||
|
||||
Meteor.methods({ |
@ -1,4 +1,5 @@ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { RocketChat } from 'meteor/rocketchat:lib'; |
||||
|
||||
Meteor.publish('oauthApps', function() { |
||||
if (!this.userId) { |
@ -0,0 +1,7 @@ |
||||
import './models/OAuthApps'; |
||||
import './oauth/oauth2-server'; |
||||
import './oauth/default-services'; |
||||
import './admin/publications/oauthApps'; |
||||
import './admin/methods/addOAuthApp'; |
||||
import './admin/methods/updateOAuthApp'; |
||||
import './admin/methods/deleteOAuthApp'; |
@ -1,3 +1,5 @@ |
||||
import { RocketChat } from 'meteor/rocketchat:lib'; |
||||
|
||||
if (!RocketChat.models.OAuthApps.findOne('zapier')) { |
||||
RocketChat.models.OAuthApps.insert({ |
||||
_id: 'zapier', |
@ -1,6 +1,7 @@ |
||||
/* global OAuth2Server */ |
||||
import { Meteor } from 'meteor/meteor'; |
||||
import { WebApp } from 'meteor/webapp'; |
||||
import { RocketChat } from 'meteor/rocketchat:lib'; |
||||
import { OAuth2Server } from 'meteor/rocketchat:oauth2-server'; |
||||
|
||||
const oauth2server = new OAuth2Server({ |
||||
accessTokensCollectionName: 'rocketchat_oauth_access_tokens', |
Loading…
Reference in new issue