[NEW] Wordpress auth (#1633)
|
@ -118,7 +118,7 @@ Readme will guide you on how to config.
|
||||||
| Accessibility (Medium) | ❌ |
|
| Accessibility (Medium) | ❌ |
|
||||||
| Accessibility (Advanced) | ❌ |
|
| Accessibility (Advanced) | ❌ |
|
||||||
| Authentication via Meteor | ❌ |
|
| Authentication via Meteor | ❌ |
|
||||||
| Authentication via Wordpress | ❌ |
|
| Authentication via Wordpress | ✅ |
|
||||||
| Authentication via Custom OAuth | ✅ |
|
| Authentication via Custom OAuth | ✅ |
|
||||||
| Add user to the room | ✅ |
|
| Add user to the room | ✅ |
|
||||||
| Send message | ✅ |
|
| Send message | ✅ |
|
||||||
|
|
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 5.7 KiB |
After Width: | Height: | Size: 7.8 KiB |
|
@ -903,6 +903,8 @@ const RocketChat = {
|
||||||
name, custom, showButton = true, service
|
name, custom, showButton = true, service
|
||||||
} = services;
|
} = services;
|
||||||
|
|
||||||
|
const authName = name || service;
|
||||||
|
|
||||||
if (custom && showButton) {
|
if (custom && showButton) {
|
||||||
return 'oauth_custom';
|
return 'oauth_custom';
|
||||||
}
|
}
|
||||||
|
@ -916,8 +918,8 @@ const RocketChat = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove this after other oauth providers are implemented. e.g. Drupal, github_enterprise
|
// TODO: remove this after other oauth providers are implemented. e.g. Drupal, github_enterprise
|
||||||
const availableOAuth = ['facebook', 'github', 'gitlab', 'google', 'linkedin', 'meteor-developer', 'twitter'];
|
const availableOAuth = ['facebook', 'github', 'gitlab', 'google', 'linkedin', 'meteor-developer', 'twitter', 'wordpress'];
|
||||||
return availableOAuth.includes(name) ? 'oauth' : 'not_supported';
|
return availableOAuth.includes(authName) ? 'oauth' : 'not_supported';
|
||||||
},
|
},
|
||||||
getUsernameSuggestion() {
|
getUsernameSuggestion() {
|
||||||
// RC 0.65.0
|
// RC 0.65.0
|
||||||
|
|
|
@ -232,6 +232,17 @@ class LoginSignupView extends React.Component {
|
||||||
this.openOAuth({ url });
|
this.openOAuth({ url });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPressWordpress = () => {
|
||||||
|
const { services, server } = this.props;
|
||||||
|
const { clientId, serverURL } = services.wordpress;
|
||||||
|
const endpoint = `${ serverURL }/oauth/authorize`;
|
||||||
|
const redirect_uri = `${ server }/_oauth/wordpress?close`;
|
||||||
|
const scope = 'openid';
|
||||||
|
const state = this.getOAuthState();
|
||||||
|
const params = `?client_id=${ clientId }&redirect_uri=${ redirect_uri }&scope=${ scope }&state=${ state }&response_type=code`;
|
||||||
|
this.openOAuth({ url: `${ endpoint }${ params }` });
|
||||||
|
}
|
||||||
|
|
||||||
onPressCustomOAuth = (loginService) => {
|
onPressCustomOAuth = (loginService) => {
|
||||||
const { server } = this.props;
|
const { server } = this.props;
|
||||||
const {
|
const {
|
||||||
|
@ -314,7 +325,8 @@ class LoginSignupView extends React.Component {
|
||||||
google: this.onPressGoogle,
|
google: this.onPressGoogle,
|
||||||
linkedin: this.onPressLinkedin,
|
linkedin: this.onPressLinkedin,
|
||||||
'meteor-developer': this.onPressMeteor,
|
'meteor-developer': this.onPressMeteor,
|
||||||
twitter: this.onPressTwitter
|
twitter: this.onPressTwitter,
|
||||||
|
wordpress: this.onPressWordpress
|
||||||
};
|
};
|
||||||
return oauthProviders[name];
|
return oauthProviders[name];
|
||||||
}
|
}
|
||||||
|
|
23
ios/RocketChatRN/Images.xcassets/Icons/icon_wordpress.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "iconWordpress.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "iconWordpress@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "iconWordpress@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
BIN
ios/RocketChatRN/Images.xcassets/Icons/icon_wordpress.imageset/iconWordpress.png
vendored
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
ios/RocketChatRN/Images.xcassets/Icons/icon_wordpress.imageset/iconWordpress@2x.png
vendored
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
ios/RocketChatRN/Images.xcassets/Icons/icon_wordpress.imageset/iconWordpress@3x.png
vendored
Normal file
After Width: | Height: | Size: 5.7 KiB |