Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created start layout for internal area with login and shop management #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mennthor
Copy link
Contributor

Start route for internal area is now /login.
No proper credential handling is included, only mockup.
On successful login, internal landing area is shown.
User can got to new shop registration or shop management for existing shops from there.

methods: {
login() {
// Routes to internal area if login successful
if(this.input.username != '' && this.input.password != '') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POST to /api/login using ajax and check return code (200 = authenticated, 401 not authenticated).
It also provides info what the reason for the denial is (wrong_credentials or a missing_role.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import JQuery from 'jquery'
JQuery.ajax(
    '/api/login',
    {
         method: "POST",
         data: {username: this.username, password: this.password},
         success: () => {handle sucess case here},
         error: (response) => {handle error case here}
    }
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants