Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
RocketChat
Rocket.Chat.ReactNative
Commits
d2df4c6d
Unverified
Commit
d2df4c6d
authored
Jan 29, 2020
by
Diego Mello
Committed by
GitHub
Jan 29, 2020
Browse files
[NEW] Wordpress auth (#1633)
parent
514e73c7
Changes
12
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
d2df4c6d
...
...
@@ -118,7 +118,7 @@ Readme will guide you on how to config.
| Accessibility (Medium) | ❌ |
| Accessibility (Advanced) | ❌ |
| Authentication via Meteor | ❌ |
| Authentication via Wordpress |
❌
|
| Authentication via Wordpress |
✅
|
| Authentication via Custom OAuth | ✅ |
| Add user to the room | ✅ |
| Send message | ✅ |
...
...
android/app/src/main/res/drawable-hdpi/icon_wordpress.png
0 → 100644
View file @
d2df4c6d
2.43 KB
android/app/src/main/res/drawable-mdpi/icon_wordpress.png
0 → 100644
View file @
d2df4c6d
1.39 KB
android/app/src/main/res/drawable-xhdpi/icon_wordpress.png
0 → 100644
View file @
d2df4c6d
3.47 KB
android/app/src/main/res/drawable-xxhdpi/icon_wordpress.png
0 → 100644
View file @
d2df4c6d
5.7 KB
android/app/src/main/res/drawable-xxxhdpi/icon_wordpress.png
0 → 100644
View file @
d2df4c6d
7.77 KB
app/lib/rocketchat.js
View file @
d2df4c6d
...
...
@@ -903,6 +903,8 @@ const RocketChat = {
name
,
custom
,
showButton
=
true
,
service
}
=
services
;
const
authName
=
name
||
service
;
if
(
custom
&&
showButton
)
{
return
'
oauth_custom
'
;
}
...
...
@@ -916,8 +918,8 @@ const RocketChat = {
}
// TODO: remove this after other oauth providers are implemented. e.g. Drupal, github_enterprise
const
availableOAuth
=
[
'
facebook
'
,
'
github
'
,
'
gitlab
'
,
'
google
'
,
'
linkedin
'
,
'
meteor-developer
'
,
'
twitter
'
];
return
availableOAuth
.
includes
(
n
ame
)
?
'
oauth
'
:
'
not_supported
'
;
const
availableOAuth
=
[
'
facebook
'
,
'
github
'
,
'
gitlab
'
,
'
google
'
,
'
linkedin
'
,
'
meteor-developer
'
,
'
twitter
'
,
'
wordpress
'
];
return
availableOAuth
.
includes
(
authN
ame
)
?
'
oauth
'
:
'
not_supported
'
;
},
getUsernameSuggestion
()
{
// RC 0.65.0
...
...
app/views/LoginSignupView.js
View file @
d2df4c6d
...
...
@@ -232,6 +232,17 @@ class LoginSignupView extends React.Component {
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
)
=>
{
const
{
server
}
=
this
.
props
;
const
{
...
...
@@ -314,7 +325,8 @@ class LoginSignupView extends React.Component {
google
:
this
.
onPressGoogle
,
linkedin
:
this
.
onPressLinkedin
,
'
meteor-developer
'
:
this
.
onPressMeteor
,
twitter
:
this
.
onPressTwitter
twitter
:
this
.
onPressTwitter
,
wordpress
:
this
.
onPressWordpress
};
return
oauthProviders
[
name
];
}
...
...
ios/RocketChatRN/Images.xcassets/Icons/icon_wordpress.imageset/Contents.json
0 → 100644
View file @
d2df4c6d
{
"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"
}
}
\ No newline at end of file
ios/RocketChatRN/Images.xcassets/Icons/icon_wordpress.imageset/iconWordpress.png
0 → 100644
View file @
d2df4c6d
1.39 KB
ios/RocketChatRN/Images.xcassets/Icons/icon_wordpress.imageset/iconWordpress@2x.png
0 → 100644
View file @
d2df4c6d
3.47 KB
ios/RocketChatRN/Images.xcassets/Icons/icon_wordpress.imageset/iconWordpress@3x.png
0 → 100644
View file @
d2df4c6d
5.7 KB
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment