Instead of using your own OpenID Provider, you can also use external providers. For details on how
to configure authentication for external providers like GitHub, please refer to [the nuxt-oauth documentation](https://auth.nuxtjs.org/schemes/oauth2.html)
### Installation
Installation is done with `npm`. Execute the following commands after changing to the user-panel/frontend
directory.
```
cd user-panel/frontend
npm install --production
```
...
...
@@ -25,14 +55,6 @@ or
npm build-start
```
### Configuration
Configuration has to be specified in `nuxt.config.js`. Setting the OpenID Connect paramaters
correctly is essential for the login process to work.
For details on how to configure authentication for external providers like GitHub or Facebook
please refer to [the nuxt-oauth documentation](https://auth.nuxtjs.org/schemes/oauth2.html)
### Usage
...
...
@@ -40,27 +62,52 @@ Navigate your browser to the `server` URL, that you specified in `nuxt.config.js
is 3000.
As an administrator you can access the user backend API by accessing the api endpoint
that is exposed by the userpanel at `/api/admin/graphql`. If you run your backend server in
that is exposed by the user-panel at `/api/admin/graphql`. If you run your backend server in
development mode, you can access the `GraphiQL` web interface of the backend by navigating
your browser to the URL.
Note that you need to manually provide a cookie containing the Baerer token in case you don't
Note that you need to manually provide a cookie containing the Bearer token in case you don't
access the api with a browser that automatically includes your cookie in the request.
Passing the token as a GET or POST variable is not supported.
### Run the tests
### Testing
Install the development dependencies with
The test folder includes end to end tests that you can run from your workstation to check if
your setup is working properly especially in case you want to make changes to the code.
#### Prerequisites
E2E tests are executed with chromedriver. Make sure that you have a supported version
of chromium installed. To downgrade the chromium version that is used in the tests, change
the version number in `package.json`[accordingly](https://www.npmjs.com/package/chromedriver).
In order to run the tests you also need to install additional node packages.
The development and testing dependencies can be installed with
```
npm install # without --production
```
Configure the application as described above.
After creating two regular users and an admin user by assigning the role `admin` to the admin
user and granting the admin and one of the test users access to the `user-panel` application,
configure the default values in `test/nightwatch_globals.js`. Don't forget to set the usernames
and passwords of the test users you created. After that, run `npm run test`.
The tests will use login credentials of 3 different users.
* Create a user that has the role `admin`and the application `user-panel` assigned to it.
* Create a second user and only assign the application `user-panel`.
* Create a third user and don't assign anything to it.
Note: E2E tests are executed with chromedriver. Make sure that you have a supported version
of chromium installed. To downgrade the chromium version that is used in the tests, change
the version number in `package.json`[accordingly](https://www.npmjs.com/package/chromedriver).
You can use the utility scripts provided in the backend folder of this repo to create the users