-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added JWT for authentication. Added Route Based Authentication. Added DataSeeder Added Auth Functions and Routes ..... and many more bug fixes
- Loading branch information
Showing
35 changed files
with
1,998 additions
and
1,855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,31 @@ | ||
'use strict' | ||
'use strict'; | ||
|
||
class ProfileController { | ||
class ProfileController | ||
{ | ||
|
||
async index({request, response, auth}) | ||
{ | ||
|
||
try | ||
{ | ||
let user = await auth.getUser(); | ||
|
||
return response.status(200).json({ | ||
status: "OK", | ||
authentication: "AUTHENTICATED", | ||
data: user | ||
}) | ||
} | ||
catch (err) | ||
{ | ||
return response.status(302).json({ | ||
status: "ERROR", | ||
message: "Please Re-Login" | ||
}) | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
module.exports = ProfileController; |
Oops, something went wrong.