Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boco-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
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
idatt2106_2022_02
boco-frontend
Commits
db170cd9
Commit
db170cd9
authored
2 years ago
by
Titus Netland
Browse files
Options
Downloads
Patches
Plain Diff
Rerouting on successful login and enter clicks running the login method
parent
6d216cf1
No related branches found
No related tags found
1 merge request
!12
API login mock tests
Pipeline
#175873
passed
2 years ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/HelloWorld.vue
+8
-120
8 additions, 120 deletions
src/components/HelloWorld.vue
src/components/LoginForm.vue
+5
-5
5 additions, 5 deletions
src/components/LoginForm.vue
with
13 additions
and
125 deletions
src/components/HelloWorld.vue
+
8
−
120
View file @
db170cd9
<
template
>
<v-container>
<v-row
class=
"text-center"
>
<v-col
cols=
"12"
>
<v-img
:src=
"require('../assets/logo.svg')"
class=
"my-3"
contain
height=
"200"
/>
</v-col>
<div
class=
"flex justify-center"
>
<router-link
to=
"/"
class=
"m-6"
>
Logg inn
</router-link>
<v-col
class=
"mb-4"
>
<h1
class=
"display-2 font-weight-bold mb-3"
>
Welcome to the Vuetify 3 Beta
</h1>
<router-link
to=
"/register"
class=
"m-6"
>
Registrer deg
</router-link>
<p
class=
"subheading font-weight-regular"
>
For help and collaboration with other Vuetify developers,
<br
/>
please join our online
<a
href=
"https://community.vuetifyjs.com"
target=
"_blank"
>
Discord Community
</a
>
</p>
</v-col>
<v-col
class=
"mb-5"
cols=
"12"
>
<h2
class=
"headline font-weight-bold mb-5"
>
What's next?
</h2>
<v-row
justify=
"center"
>
<a
v-for=
"(next, i) in whatsNext"
:key=
"i"
:href=
"next.href"
class=
"subheading mx-3"
target=
"_blank"
>
{{
next
.
text
}}
</a>
</v-row>
</v-col>
<v-col
class=
"mb-5"
cols=
"12"
>
<h2
class=
"headline font-weight-bold mb-5"
>
Important Links
</h2>
<v-row
justify=
"center"
>
<a
v-for=
"(link, i) in importantLinks"
:key=
"i"
:href=
"link.href"
class=
"subheading mx-3"
target=
"_blank"
>
{{
link
.
text
}}
</a>
</v-row>
</v-col>
<v-col
class=
"mb-5"
cols=
"12"
>
<h2
class=
"headline font-weight-bold mb-5"
>
Ecosystem
</h2>
<v-row
justify=
"center"
>
<a
v-for=
"(eco, i) in ecosystem"
:key=
"i"
:href=
"eco.href"
class=
"subheading mx-3"
target=
"_blank"
>
{{
eco
.
text
}}
</a>
</v-row>
</v-col>
</v-row>
</v-container>
<router-link
to=
"/about"
class=
"m-6"
>
Om BoCo
</router-link>
</div>
</
template
>
<
script
>
...
...
@@ -80,52 +13,7 @@ export default {
name
:
"
HelloWorld
"
,
data
:
()
=>
({
ecosystem
:
[
{
text
:
"
vuetify-loader
"
,
href
:
"
https://github.com/vuetifyjs/vuetify-loader
"
,
},
{
text
:
"
github
"
,
href
:
"
https://github.com/vuetifyjs/vuetify
"
,
},
{
text
:
"
awesome-vuetify
"
,
href
:
"
https://github.com/vuetifyjs/awesome-vuetify
"
,
},
],
importantLinks
:
[
{
text
:
"
Chat
"
,
href
:
"
https://community.vuetifyjs.com
"
,
},
{
text
:
"
Made with Vuetify
"
,
href
:
"
https://madewithvuejs.com/vuetify
"
,
},
{
text
:
"
Twitter
"
,
href
:
"
https://twitter.com/vuetifyjs
"
,
},
{
text
:
"
Articles
"
,
href
:
"
https://medium.com/vuetify
"
,
},
],
whatsNext
:
[
{
text
:
"
Explore components
"
,
href
:
"
https://vuetifyjs.com
"
,
},
{
text
:
"
Roadmap
"
,
href
:
"
https://vuetifyjs.com/introduction/roadmap/
"
,
},
{
text
:
"
Frequently Asked Questions
"
,
href
:
"
https://vuetifyjs.com/getting-started/frequently-asked-questions
"
,
},
],
}),
};
}),
}
</
script
>
This diff is collapsed.
Click to expand it.
src/components/LoginForm.vue
+
5
−
5
View file @
db170cd9
...
...
@@ -52,6 +52,7 @@
class=
"bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
v-model=
"v$.user.password.$model"
required
@
keyup.enter=
"loginClicked"
/>
<!-- error message -->
<div
...
...
@@ -157,13 +158,12 @@ export default {
this
.
message
=
"
Feil e-post/passord
"
;
this
.
$store
.
commit
(
"
logout
"
);
}
else
if
(
loginResponse
.
isLoggedIn
===
true
){
this
.
$store
.
commit
(
"
saveToken
"
,
loginResponse
);
this
.
message
=
loginResponse
.
token
;
console
.
log
(
"
Logged in
"
)
else
if
(
loginResponse
.
isLoggedIn
===
true
)
{
this
.
$store
.
commit
(
"
saveToken
"
,
loginResponse
.
token
);
await
this
.
$router
.
push
(
"
/endre
"
);
}
else
{
console
.
log
(
"
Something went wrong
"
)
console
.
log
(
"
Something went wrong
"
)
;
}
},
...
...
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