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

#82 - Authenticate with discord #77

Merged
merged 58 commits into from
Jun 22, 2021

Conversation

TomBurch
Copy link
Member

No description provided.

@Freddo3000 Freddo3000 marked this pull request as draft June 12, 2021 20:48
@TomBurch TomBurch linked an issue Jun 16, 2021 that may be closed by this pull request
Comment on lines +36 to +42
if (!auth()->guest()) {
if (is_null(auth()->user()->discord_id)) {
auth()->user()->discord_id = $user->id;
auth()->user()->save();
return redirect('/hub');
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

For migrating existing users

Comment on lines +39 to +44
$user = User::where('steam_id', $data->id)->first();

if (is_null($user)) {
return [
'error' => 'Account not found.'
];
Copy link
Member Author

Choose a reason for hiding this comment

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

This will only login existing users - new users can't authenticate with steam

$user = User::findOrFail($request->user_id);

return $this->update($request, $user);
//

Choose a reason for hiding this comment

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

Why comment out these functions?

Copy link
Member Author

Choose a reason for hiding this comment

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

These were used by admins in the User display to update permissions

Now that permissions are handled through Discord roles the ability to update permissions through the site was removed

The reason that I've left the functions there, but with no functionality, is I believe User is defined as a REST resource (so should implement CRUD methods)

@BorderKeeper BorderKeeper marked this pull request as ready for review June 21, 2021 17:57
@BorderKeeper
Copy link

BorderKeeper commented Jun 21, 2021

lgtm

Plans for release:

  • Ask admins if current role and permission system is okay
  • Put message in discord telling people about it and telling them to go through staff if they are a member and logged off after we deploy this feature
  • Merging this and deploying
  • After a week or so checking database for duplicated accounts and merging them

@TomBurch TomBurch changed the title WIP: #82 - Authenticate with discord #82 - Authenticate with discord Jun 22, 2021
@BorderKeeper BorderKeeper merged commit 58d6a3d into ARCOMM:master Jun 22, 2021
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.

Authenticate with discord
3 participants