Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Pleroma
admin-fe
Merge requests
!39
Get instance from window.location if it is not provided in the username field
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Get instance from window.location if it is not provided in the username field
linafilippova/admin-fe:feature/login-improvements
into
master
Overview
0
Commits
3
Pipelines
1
Changes
4
Merged
Angelina Filippova
requested to merge
linafilippova/admin-fe:feature/login-improvements
into
master
5 years ago
Overview
0
Commits
3
Pipelines
1
Changes
4
Expand
Closes
#27 (closed)
1
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
2a4f3eed
3 commits,
5 years ago
4 files
+
46
−
44
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
src/api/__mocks__/login.js
+
4
−
3
Options
const
users
=
[
{
username
:
'
bob
'
,
password
:
'
123456
'
}
{
username
:
'
bob
'
,
password
:
'
123456
'
,
authHost
:
'
pleroma
'
}
]
export
async
function
loginByUsername
(
username
,
password
)
{
export
async
function
loginByUsername
(
username
,
password
,
authHost
)
{
const
user
=
users
.
find
(
user
=>
user
.
username
===
username
)
const
verifyPassword
=
user
.
password
===
password
const
verifyHost
=
user
.
authHost
===
authHost
const
data
=
{
'
token_type
'
:
'
Bearer
'
,
'
scope
'
:
'
read write follow
'
,
@@ -14,7 +15,7 @@ export async function loginByUsername(username, password) {
'
access_token
'
:
'
bar123
'
}
return
verifyPassword
return
verifyPassword
&&
verifyHost
?
Promise
.
resolve
({
data
})
:
Promise
.
reject
({
message
:
'
Invalid credentials
'
})
}
Loading