mirror of
https://github.com/opelly27/WinStudentGoalTracker.git
synced 2026-05-20 07:37:38 +00:00
changed login flow to support 2 phase program selection login.
This commit is contained in:
@@ -11,6 +11,7 @@ public class AuthRepository
|
||||
public async Task<Guid?> CreateRefreshTokenAsync(
|
||||
Guid refreshTokenId,
|
||||
Guid userId,
|
||||
Guid programId,
|
||||
string tokenHash,
|
||||
string tokenSalt,
|
||||
int expiresInSeconds,
|
||||
@@ -24,6 +25,7 @@ public class AuthRepository
|
||||
{
|
||||
p_id_refresh_token = refreshTokenId.ToString(),
|
||||
p_id_user = userId.ToString(),
|
||||
p_id_program = programId.ToString(),
|
||||
p_token_hash = tokenHash,
|
||||
p_token_salt = tokenSalt,
|
||||
p_expires_in_seconds = expiresInSeconds,
|
||||
@@ -57,6 +59,7 @@ public class AuthRepository
|
||||
Guid oldTokenId,
|
||||
Guid newTokenId,
|
||||
Guid userId,
|
||||
Guid programId,
|
||||
string tokenHash,
|
||||
string tokenSalt,
|
||||
int expiresInSeconds,
|
||||
@@ -71,6 +74,7 @@ public class AuthRepository
|
||||
p_old_token_id = oldTokenId.ToString(),
|
||||
p_id_refresh_token = newTokenId.ToString(),
|
||||
p_id_user = userId.ToString(),
|
||||
p_id_program = programId.ToString(),
|
||||
p_token_hash = tokenHash,
|
||||
p_token_salt = tokenSalt,
|
||||
p_expires_in_seconds = expiresInSeconds,
|
||||
|
||||
@@ -25,4 +25,22 @@ public class UserRepository
|
||||
new { p_id_user = idUser.ToString() },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
|
||||
public async Task<dbProgramUser?> GetByIdWithProgramAsync(Guid idUser, Guid idProgram)
|
||||
{
|
||||
using var db = Connection;
|
||||
return await db.QuerySingleOrDefaultAsync<dbProgramUser>(
|
||||
"sp_User_GetById_WithProgram",
|
||||
new { p_id_user = idUser.ToString(), p_id_program = idProgram.ToString() },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<dbUserProgram>> GetProgramsForUserIdAsync(Guid idUser)
|
||||
{
|
||||
using var db = Connection;
|
||||
return await db.QueryAsync<dbUserProgram>(
|
||||
"sp_UserPrograms_GetByUserId",
|
||||
new { p_id_user = idUser.ToString() },
|
||||
commandType: CommandType.StoredProcedure);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user