Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
2abecea0
Commit
2abecea0
authored
Apr 28, 2019
by
Nick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: google auth module
parent
06497fe0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
9 deletions
+20
-9
authentication.js
server/modules/authentication/dropbox/authentication.js
+0
-1
authentication.js
server/modules/authentication/google/authentication.js
+14
-6
definition.yml
server/modules/authentication/google/definition.yml
+5
-1
definition.yml
server/modules/authentication/slack/definition.yml
+1
-1
No files found.
server/modules/authentication/dropbox/authentication.js
View file @
2abecea0
...
...
@@ -16,7 +16,6 @@ module.exports = {
clientSecret
:
conf
.
clientSecret
,
callbackURL
:
conf
.
callbackURL
},
async
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
console
.
info
(
profile
)
try
{
const
user
=
await
WIKI
.
models
.
users
.
processProfile
({
profile
:
{
...
...
server/modules/authentication/google/authentication.js
View file @
2abecea0
...
...
@@ -5,6 +5,7 @@
// ------------------------------------
const
GoogleStrategy
=
require
(
'passport-google-oauth20'
).
Strategy
const
_
=
require
(
'lodash'
)
module
.
exports
=
{
init
(
passport
,
conf
)
{
...
...
@@ -13,12 +14,19 @@ module.exports = {
clientID
:
conf
.
clientId
,
clientSecret
:
conf
.
clientSecret
,
callbackURL
:
conf
.
callbackURL
},
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
WIKI
.
models
.
users
.
processProfile
(
profile
).
then
((
user
)
=>
{
return
cb
(
null
,
user
)
||
true
}).
catch
((
err
)
=>
{
return
cb
(
err
,
null
)
||
true
})
},
async
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
try
{
const
user
=
await
WIKI
.
models
.
users
.
processProfile
({
profile
:
{
...
profile
,
picture
:
_
.
get
(
profile
,
'photos[0].value'
,
''
)
},
providerKey
:
'google'
})
cb
(
null
,
user
)
}
catch
(
err
)
{
cb
(
err
,
null
)
}
})
)
}
...
...
server/modules/authentication/google/definition.yml
View file @
2abecea0
...
...
@@ -5,8 +5,12 @@ author: requarks.io
logo
:
https://static.requarks.io/logo/google.svg
color
:
red darken-1
website
:
https://console.developers.google.com/
isAvailable
:
fals
e
isAvailable
:
tru
e
useForm
:
false
scopes
:
-
profile
-
email
-
openid
props
:
clientId
:
type
:
String
...
...
server/modules/authentication/slack/definition.yml
View file @
2abecea0
...
...
@@ -7,7 +7,7 @@ color: green
website
:
https://api.slack.com/docs/oauth
isAvailable
:
true
useForm
:
false
scope
:
scope
s
:
-
identity.basic
-
identity.email
-
identity.avatar
...
...
Write
Preview
Markdown
is supported
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