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
You need to sign in or sign up before continuing.
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 = {
...
@@ -16,7 +16,6 @@ module.exports = {
clientSecret
:
conf
.
clientSecret
,
clientSecret
:
conf
.
clientSecret
,
callbackURL
:
conf
.
callbackURL
callbackURL
:
conf
.
callbackURL
},
async
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
},
async
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
console
.
info
(
profile
)
try
{
try
{
const
user
=
await
WIKI
.
models
.
users
.
processProfile
({
const
user
=
await
WIKI
.
models
.
users
.
processProfile
({
profile
:
{
profile
:
{
...
...
server/modules/authentication/google/authentication.js
View file @
2abecea0
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
// ------------------------------------
// ------------------------------------
const
GoogleStrategy
=
require
(
'passport-google-oauth20'
).
Strategy
const
GoogleStrategy
=
require
(
'passport-google-oauth20'
).
Strategy
const
_
=
require
(
'lodash'
)
module
.
exports
=
{
module
.
exports
=
{
init
(
passport
,
conf
)
{
init
(
passport
,
conf
)
{
...
@@ -13,12 +14,19 @@ module.exports = {
...
@@ -13,12 +14,19 @@ module.exports = {
clientID
:
conf
.
clientId
,
clientID
:
conf
.
clientId
,
clientSecret
:
conf
.
clientSecret
,
clientSecret
:
conf
.
clientSecret
,
callbackURL
:
conf
.
callbackURL
callbackURL
:
conf
.
callbackURL
},
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
},
async
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
WIKI
.
models
.
users
.
processProfile
(
profile
).
then
((
user
)
=>
{
try
{
return
cb
(
null
,
user
)
||
true
const
user
=
await
WIKI
.
models
.
users
.
processProfile
({
}).
catch
((
err
)
=>
{
profile
:
{
return
cb
(
err
,
null
)
||
true
...
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
...
@@ -5,8 +5,12 @@ author: requarks.io
logo
:
https://static.requarks.io/logo/google.svg
logo
:
https://static.requarks.io/logo/google.svg
color
:
red darken-1
color
:
red darken-1
website
:
https://console.developers.google.com/
website
:
https://console.developers.google.com/
isAvailable
:
fals
e
isAvailable
:
tru
e
useForm
:
false
useForm
:
false
scopes
:
-
profile
-
email
-
openid
props
:
props
:
clientId
:
clientId
:
type
:
String
type
:
String
...
...
server/modules/authentication/slack/definition.yml
View file @
2abecea0
...
@@ -7,7 +7,7 @@ color: green
...
@@ -7,7 +7,7 @@ color: green
website
:
https://api.slack.com/docs/oauth
website
:
https://api.slack.com/docs/oauth
isAvailable
:
true
isAvailable
:
true
useForm
:
false
useForm
:
false
scope
:
scope
s
:
-
identity.basic
-
identity.basic
-
identity.email
-
identity.email
-
identity.avatar
-
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