Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
frag.jetzt SWTP 2022
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Marc Tröll
frag.jetzt SWTP 2022
Commits
a75a4dd5
Verified
Commit
a75a4dd5
authored
7 years ago
by
Lukas Maximilian Kimpel
Browse files
Options
Downloads
Patches
Plain Diff
Bundle url strings
parent
c9a7cef4
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/authentication.service.ts
+14
-12
14 additions, 12 deletions
src/app/authentication.service.ts
with
14 additions
and
12 deletions
src/app/authentication.service.ts
+
14
−
12
View file @
a75a4dd5
...
...
@@ -12,14 +12,16 @@ import { ClientAuthentication } from './client-authentication';
export
class
AuthenticationService
{
private
readonly
STORAGE_KEY
:
string
=
'
USER
'
;
private
user
:
User
;
private
apiBaseUrl
=
'
https://arsnova-staging.mni.thm.de/api
'
;
private
apiV2Url
=
'
https://arsnova-staging.mni.thm.de/v2
'
;
private
apiAuthUrl
=
'
/auth
'
;
private
apiLoginUrl
=
'
/login
'
;
private
apiUserUrl
=
'
/user
'
;
private
apiRegisterUrl
=
'
/register
'
;
private
apiRegisteredUrl
=
'
/registered
'
;
private
apiResetPasswordUrl
=
'
/resetpassword
'
;
private
apiUrl
=
{
baseUrl
:
'
https://arsnova-staging.mni.thm.de/api
'
,
v2Url
:
'
https://arsnova-staging.mni.thm.de/v2
'
,
authUrl
:
'
/auth
'
,
loginUrl
:
'
/login
'
,
userUrl
:
'
/user
'
,
registerUrl
:
'
/register
'
,
registeredUrl
:
'
/registered
'
,
resetPasswordUrl
:
'
/resetpassword
'
};
private
httpOptions
=
{
headers
:
new
HttpHeaders
({})
};
...
...
@@ -33,7 +35,7 @@ export class AuthenticationService {
}
login
(
email
:
string
,
password
:
string
,
userRole
:
UserRole
):
Observable
<
boolean
>
{
const
connectionUrl
:
string
=
this
.
api
B
aseUrl
+
this
.
api
A
uthUrl
+
this
.
api
L
oginUrl
+
this
.
api
R
egisteredUrl
;
const
connectionUrl
:
string
=
this
.
api
Url
.
b
aseUrl
+
this
.
api
Url
.
a
uthUrl
+
this
.
api
Url
.
l
oginUrl
+
this
.
api
Url
.
r
egisteredUrl
;
return
this
.
checkLogin
(
this
.
http
.
post
<
ClientAuthentication
>
(
connectionUrl
,
{
loginId
:
email
,
...
...
@@ -42,13 +44,13 @@ export class AuthenticationService {
}
guestLogin
():
Observable
<
boolean
>
{
const
connectionUrl
:
string
=
this
.
api
B
aseUrl
+
this
.
api
A
uthUrl
+
this
.
api
L
oginUrl
+
'
/guest
'
;
const
connectionUrl
:
string
=
this
.
api
Url
.
b
aseUrl
+
this
.
api
Url
.
a
uthUrl
+
this
.
api
Url
.
l
oginUrl
+
'
/guest
'
;
return
this
.
checkLogin
(
this
.
http
.
post
<
ClientAuthentication
>
(
connectionUrl
,
null
,
this
.
httpOptions
),
UserRole
.
PARTICIPANT
);
}
register
(
email
:
string
,
password
:
string
):
Observable
<
ClientAuthentication
>
{
const
connectionUrl
:
string
=
this
.
api
B
aseUrl
+
this
.
api
R
egisterUrl
;
const
connectionUrl
:
string
=
this
.
api
Url
.
b
aseUrl
+
this
.
api
Url
.
r
egisterUrl
;
return
this
.
http
.
post
<
ClientAuthentication
>
(
connectionUrl
,
{
loginId
:
email
,
...
...
@@ -57,7 +59,7 @@ export class AuthenticationService {
}
resetPassword
(
email
:
string
):
Observable
<
boolean
>
{
const
connectionUrl
:
string
=
this
.
api
V
2Url
+
this
.
apiUserUrl
+
email
+
this
.
api
R
esetPasswordUrl
;
const
connectionUrl
:
string
=
this
.
api
Url
.
v
2Url
+
this
.
apiU
rl
.
u
serUrl
+
email
+
this
.
api
Url
.
r
esetPasswordUrl
;
return
this
.
http
.
post
<
boolean
>
(
connectionUrl
,
{
key
:
null
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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