Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
2ef1d974
Unverified
Commit
2ef1d974
authored
Sep 12, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
Fix #12879
parent
2200ba1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
src/main/java/org/b3log/solo/processor/OAuthProcessor.java
src/main/java/org/b3log/solo/processor/OAuthProcessor.java
+15
-3
No files found.
src/main/java/org/b3log/solo/processor/OAuthProcessor.java
View file @
2ef1d974
...
@@ -54,7 +54,7 @@ import java.util.concurrent.ConcurrentHashMap;
...
@@ -54,7 +54,7 @@ import java.util.concurrent.ConcurrentHashMap;
* </ul>
* </ul>
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.
0, Jul 13
, 2019
* @version 1.0.1.
1, Sep 12
, 2019
* @since 2.9.5
* @since 2.9.5
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -197,7 +197,7 @@ public class OAuthProcessor {
...
@@ -197,7 +197,7 @@ public class OAuthProcessor {
try
{
try
{
userMgmtService
.
addUser
(
addUserReq
);
userMgmtService
.
addUser
(
addUserReq
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Register via oauth failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Register
s
via oauth failed"
,
e
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
return
;
return
;
...
@@ -207,13 +207,25 @@ public class OAuthProcessor {
...
@@ -207,13 +207,25 @@ public class OAuthProcessor {
try
{
try
{
userMgmtService
.
updateUser
(
user
);
userMgmtService
.
updateUser
(
user
);
}
catch
(
final
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Update user GitHub id failed"
,
e
);
LOGGER
.
log
(
Level
.
ERROR
,
"Update
s
user GitHub id failed"
,
e
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
return
;
return
;
}
}
}
}
}
}
}
else
{
// 更改账号后无法登录 https://github.com/b3log/solo/issues/12879
// 使用 GitHub 登录名覆盖本地用户名,解决 GitHub 改名后引起的登录问题
user
.
put
(
User
.
USER_NAME
,
userName
);
try
{
userMgmtService
.
updateUser
(
user
);
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Updates user name failed"
,
e
);
context
.
sendError
(
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
);
return
;
}
}
}
user
=
userQueryService
.
getUserByName
(
userName
);
user
=
userQueryService
.
getUserByName
(
userName
);
...
...
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