Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
FDO Manager WebUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fdo
FDO Manager WebUI
Commits
6417118a
Verified
Commit
6417118a
authored
1 year ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: OAuth authn
parent
fbd489cf
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#48727
passed
1 year ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pages/_app.tsx
+1
-1
1 addition, 1 deletion
pages/_app.tsx
pages/api/auth/[...nextauth].ts
+3
-2
3 additions, 2 deletions
pages/api/auth/[...nextauth].ts
with
4 additions
and
3 deletions
pages/_app.tsx
+
1
−
1
View file @
6417118a
...
...
@@ -208,7 +208,7 @@ function MyApp ({
return
(
<
SessionProvider
session
=
{
session
}
refetchInterval
=
{
3
*
6
0
}
refetchInterval
=
{
1
0
}
refetchOnWindowFocus
=
{
true
}
>
<
App
>
{
renderComponent
()
}
</
App
>
...
...
This diff is collapsed.
Click to expand it.
pages/api/auth/[...nextauth].ts
+
3
−
2
View file @
6417118a
...
...
@@ -93,6 +93,7 @@ export const authOptions = {
// Initial sign in
if
(
account
&&
user
)
{
return
{
lastRefresh
:
Date
.
now
(),
accessToken
:
account
.
access_token
,
accessTokenExpires
:
account
.
expires_at
,
refreshToken
:
account
.
refresh_token
,
...
...
@@ -100,8 +101,8 @@ export const authOptions = {
}
}
// Return previous token if the access token will still not be expired in 60 seconds.
if
(
Date
.
now
()
+
60000
<
token
.
accessTokenExpires
)
{
if
(
token
.
lastRefresh
+
10000
>
Date
.
now
())
{
// return if last refresh is 10 seconds or younger
return
token
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment